[Numpy-discussion] matplotlib - representation of nan values in 2D

Dirk Zickermann dirk.zickermann@googlemail....
Wed Sep 26 11:05:46 CDT 2007


Dear pylab group,

for the represenation of 2d measurement data I use the contourplot function
from matplotlib. Some points in this map are not measurabel, therefore I get
a non numerical value (nan) output.

>From this data I want to generate a map and a histogram plot. This works
fine, as long as I use regular matrix/array data structure without any
voids.

My questions are:
(1) How can I make use of plotting data with NAN values as contour and
asigns such values eg as black points?
(2) How can I use the matplotlib hist() function with this data, that also
include such missing data points?
Maybe there is an easy workaround for this.

Thanks a  lot for your support,
Dirk

(python2.51/matplotlib-0.90.1, win32)

my code:
...
import matplotlib
...
my2dData=[[1,2,3,4,5.0 ,NaN,7,8,9,10],[10,9,8,7,6,5,4,3,2,1]]
...
figure(1)
imshow(my2dData)
pylab.show()
..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070926/eacf709a/attachment.html 


More information about the Numpy-discussion mailing list