Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-18 Thread John Hunter
> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: Eric> John Hunter wrote: >>> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: >> Eric> they will not be transparent. If you need transparent Eric> masked regions, then try pcolor instead of imshow. Pcolor Eric>

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-17 Thread Eric Firing
John Hunter wrote: >>"Eric" == Eric Firing <[EMAIL PROTECTED]> writes: > > Eric> they will not be transparent. If you need transparent > Eric> masked regions, then try pcolor instead of imshow. Pcolor > Eric> plots nothing at all in masked cells. Pcolormesh, on the > Eric> o

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-17 Thread Eric Firing
John, It sounds like you are not using the latest *released* version of mpl, which is 0.87.3; the only thing in my example that requires svn is the colorbar command. If you did install 0.87.3, then you must have an earlier installation still in place and being found. imshow requires a uniform

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-17 Thread John Pye
Hi Eric, Thanks for your suggestion. The colorbar(shrink) command throws me an error, as you said it would. But I get another error with the '0.3', '0.5', etc. I had to replace those with (0.3,0.3,0.3) etc -- RGB tuples. Finally, my plot only shows white, grey red. I don't get any other colors --

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-17 Thread John Hunter
> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: Eric> they will not be transparent. If you need transparent Eric> masked regions, then try pcolor instead of imshow. Pcolor Eric> plots nothing at all in masked cells. Pcolormesh, on the Eric> other hand, is like imshow in p

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-16 Thread Eric Firing
John, Something like this might be what you want: from pylab import * import matplotlib.numerix.ma as ma import matplotlib.colors as colors xx = rand(10,15) xxx = (xx*15 - 5).astype(Int) xxx = ma.masked_where(xxx < 0, xxx) xxx.set_fill_value(-1) #(not necessary) cmap = colors.ListedColormap(('r',

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-15 Thread John Pye
By the way, I had some success with this, but my approach is really inefficient. Perhaps someone could suggest how I can improve the following: import matplotlib.numerix as nx from numarray import ma def enumimage(A,colors): """ Create an image from a matrix of enumerated values