From: Eric F. <ef...@ha...> - 2005-09-25 23:34:23
|
Jeff, John, I have committed to CVS a set of changes that fix the recent bug in contourf when called with the colors kwarg, and that I hope will make contour.py and everything that uses it easier to understand and use. The CHANGELOG entry is: 2005-09-25 contour.py modified to use a single ContourSet class that handles filled contours, line contours, and labels; added keyword arg (clip_ends) to contourf. Colorbar modified to work with new ContourSet object; if the ContourSet has lines rather than polygons, the colorbar will follow suit. Fixed a bug introduced in 0.84, in which contourf(...,colors=...) was broken - EF and the API_CHANGES entry is: Changed the internal structure of contour.py to a more OO style. Calls to contour or contourf in axes.py or pylab.py now return a ContourSet object which contains references to the LineCollections or PolyCollections created by the call, as well as the configuration variables that were used. The ContourSet object is a "mappable" if a colormap was used. Added a clip_ends kwarg to contourf. From the docstring: * clip_ends = True If False, the limits for color scaling are set to the minimum and maximum contour levels. True (default) clips the scaling limits. Example: if the contour boundaries are V = [-100, 2, 1, 0, 1, 2, 100], then the scaling limits will be [-100, 100] if clip_ends is False, and [-3, 3] if clip_ends is True. Changed Figure.colorbar(): kw argument order changed; if mappable arg is a non-filled ContourSet, colorbar() shows lines instead of polygons. if mappable arg is a filled ContourSet with clip_ends=True, the endpoints are not labelled, so as to give the correct impression of open-endedness. Changed LineCollection.get_linewidths to get_linewidth, for consistency. ----------------------------------- The change in contour and contourf output breaks basemap. I have made the necessary changes in my working copy; the diff against CVS is attached. If it is OK with you, Jeff, I will commit this change. Or if you would rather make the modifications yourself, let me know. What all this implies is that the next time there is a release of mpl there needs to be a simultaneous basemap release, and users will need to be warned to update both. Eric |