I'm wondering whether someone can reproduce the following problem I'm 
seeing in Ubuntu Intrepid.

I often use matplotlib to save images created with imshow to take 
advantage of matplotlib's colour maps. I've noticed that the behaviour 
is different for 0.98.3 between Windows XP-32 and Ubuntu Intrepid. I 
don't remember seeing this problem with earlier versions. This minimal 
example demonstrates the problem:

--

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm

px = 3
rcFig = {'figsize': (1, 1),
          'dpi': px,
          'subplot.bottom': 0,
          'subplot.left': 0,
          'subplot.right': 1,
          'subplot.top': 1,
          }
plt.rc('figure', **rcFig)

a = np.ones((px, px))
plt.axis('off')
plt.imshow(a, cmap=cm.gray)
plt.savefig('mpl_out.png', dpi=px)

--

In Windows I get the correct behaviour - in this case a 3x3 image with 
all black pixels:

bbb
bbb
bbb

However, in Linux the leftmost column of pixels is white

wbb
wbb
wbb

By the way, I think an imsave function that just saved an array as an 
image with a specified colourmap and clims would be a nice addition to 
matplotlib.image. Is there another way to achieve the same 1-to-1 array 
element-to-pixel image saving applying colourmaps and clims?

thanks,
Gary R.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to