From: John H. <jdh...@ac...> - 2004-07-15 12:56:45
|
>>>>> "Jeff" == Jeff Whitaker <js...@fa...> writes: Jeff> I'm pretty sure it's not the data. I only see this when I Jeff> use imshow, not pcolor. OK, I'll get this sorted out. Thanks for letting me know. Jeff> Sure. I've reworked the example a bit - now I read in a Jeff> regular lat/lon grid from a pickle and use numarray's spline Jeff> interpolation function to interpolate to the native Jeff> projection grid. Here's the modified example: It looks very nice. Perry Greenfield has provided a nice framework with matplotlib.colors.LinearSegmentedColormap to define new colormaps. You can create new colormaps fairly easy by following the example of jet in matplotlib.cm. It would be very nice if you could add some of the common cartographic colormaps. If you do get the time to do so when working on your mapping code, here are the steps * define your rgb linear segments in matplotlib.cm, following the lead of the _jet_data dictionary in that module * add an entry to the datad dictionary in that module which maps rc string names for your color map to the dictionary you just defined. * instantiate a single instance of your colormap in cm, following the example jet = colors.LinearSegmentedColormap('jet', _jet_data, LUTSIZE) * add a matplotlib.matlab function which has the same name as your colormap, following the example of matplotlib.matlab.jet. Now anyone can use the colormap interactively from the shell, by setting it as the default image.cmap in rc, etc. JDH |