Dirk Zickermann wrote: > Dear matplotlib 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?
I'm not sure what you mean. For a contour plot, you're not assigning any kind of color to data, but drawing boundaries that enclose regions with a value greater/less than a certain value. Since, AFAIK, contouring requires regularly spaced data, you might want to try interpolating to fill in the missing data before contouring. If instead, you actually want an image plot (data->colored points), I thought pcolor at least supported ignoring NaN 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. My solution here would be to create a new 1D array with the NaN points deleted before calling hist() Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users