Re: [Matplotlib-users] heatmap and masked values

2009-08-31 Thread Christian Meesters
Jeff, that's a good point. I remember ... On Thu, 2009-08-27 at 07:54 -0600, Jeff Whitaker wrote: > Christian Meesters wrote: > >> Christian: That should work, if you created the masked array > >> correctly. Why are you creating the mask with data=='NA'? I suspect > >> that this always evalua

Re: [Matplotlib-users] heatmap and masked values

2009-08-27 Thread Jeff Whitaker
Christian Meesters wrote: >> Christian: That should work, if you created the masked array >> correctly. Why are you creating the mask with data=='NA'? I suspect >> that this always evaluates to False, so you don't get a mask. You >> probably want to check for a numeric value, not a string.

Re: [Matplotlib-users] heatmap and masked values

2009-08-27 Thread Christian Meesters
> Christian: That should work, if you created the masked array > correctly. Why are you creating the mask with data=='NA'? I suspect > that this always evaluates to False, so you don't get a mask. You > probably want to check for a numeric value, not a string. For example: Thanks a lot, Je

Re: [Matplotlib-users] heatmap and masked values

2009-08-27 Thread Jeff Whitaker
Christian Meesters wrote: > Hi, > > I have a 2D masked array, created like: > > import numpy as np > data = np.ma.array(data, mask=[data == 'NA']) > > which I would like to plot as a heatmap. > > import pylab > > pylab.pcolor(data) > or > pylab.pcolormesh(data) > > Well, it works with any array, bu

[Matplotlib-users] heatmap and masked values

2009-08-27 Thread Christian Meesters
Hi, I have a 2D masked array, created like: import numpy as np data = np.ma.array(data, mask=[data == 'NA']) which I would like to plot as a heatmap. import pylab pylab.pcolor(data) or pylab.pcolormesh(data) Well, it works with any array, but not if masked values are in there. Can somebody su