From: Eric F. <ef...@ha...> - 2005-02-20 02:23:23
|
John et al., I would like to phase in matplotlib to replace Matlab ASAP for plotting physical oceanographic observations, primarily current profile measurements. I (and many other physical oceanographers) primarily use contourf to plot filled contours; I only rarely use line contours. It looks to me like gcntr.c has the necessary functionality--the ability to output polygons enclosing regions between a pair of specified levels. Is someone already working on exposing that functionality in matplotlib, or is it planned? It appears that gcntr.c also has the ability to handle missing data via setting elements of the reg array to zero, and that this could be exposed fairly easily in the contour method in axes.py by adding "reg" to the set of kwargs. Correct? If so, is this also planned? The question of missing data handling in contour plotting brings up the more general issue of how to handle data gaps in plots. For example, the ocean current profiles that I measure using a Doppler profiler extend to varying depths, and sometimes have holes in the middle where there are not enough acoustic scatterers to give a signal. This sort of thing--data gaps--is universal in physical oceanography. One of Matlab's major strengths is the way it handles them, using nan as a bad value flag. Plotting a line with the plot command, the line is broken at each nan; so if there is a hole in the data, the plot shows exactly that. The same for contouring: nans are automatically used as a mask. Obviously, not everyone needs this kind of automatic handling of data gaps, but I think it would be very useful for many applications, so I hope it can be considered as a possible goal. At the plotting level, collections may make it easier to implement than would have been the case in the early days of matplotlib. At the array manipulation level, the implementation could involve either masked arrays or nans. I would greatly prefer the Matlab-style nan approach, but I don't know whether this would work with Numeric. Maybe in Numeric3? Numarray appears better equipped, with its ieeespecial.py module. Thanks for the enormous amount of beautiful work you have already done! Eric |