| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Contourf was handling the extend kwarg by mapping the extended ranges directly into the 0-1 normal colormap range, so that using set_under and set_over had no effect. The legend support for extend options was also using the wrong names for the options.
There was a problem hiding this comment.
I hate magic numbers like this. Maybe we could use np.INF and np.NINF?
Sorry, something went wrong.
There was a problem hiding this comment.
On 2012/07/20 5:20 PM, Benjamin Root wrote:
if self.extend in ('both', 'min'):
self.layers[0] = 0.5 \* (self.vmin + self._levels[1]) self.layers[0] = -1e300I hate magic numbers like this. Maybe we could use np.INF and np.NINF?
I thought of that, and may yet do so; but I wanted to get out a fix that
would work, and could not take time to test whether potentially
dangerous things like INF would cause trouble in practice. Note that mpl
has other somewhat arbitrary special numbers, because they make it work
most of the time.
Sorry, something went wrong.
Also removed "from pylab import *".
Note that trying to simplify the code further by using np.inf a few lines above, in self._levels, does not work; I'm not sure what it breaks, but it definitely breaks something, probably in the colorbar code.
contour: map extended ranges to "under" and "over" values
| Back | FazBrowse Home | New Git URL |
Contourf was handling the extend kwarg by mapping the extended
ranges directly into the 0-1 normal colormap range, so that
using set_under and set_over had no effect; after this change, the
extended ranges are mapped outside the 0-1 range (after applying
the norm) so that the colors established by the set_under and set_over
colormap methods are used. By default, these are the end values of
the colormap. The new behavior matches the existing contourf documentation.
Fixed a bug in which the legend support for extend options was using the
wrong names for the options.