|
21 | 21 | import matplotlib.patches as mpatches |
22 | 22 | import matplotlib.texmanager as texmanager |
23 | 23 | import matplotlib.transforms as mtrans |
| 24 | +import pdb |
24 | 25 |
|
25 | 26 | # Import needed for adding manual selection capability to clabel |
26 | 27 | from matplotlib.blocking_input import BlockingContourLabeler |
@@ -1196,7 +1197,7 @@ def _process_levels(self): |
1196 | 1197 | # want to leave the original levels attribute unchanged. |
1197 | 1198 | # (Colorbar needs this even for line contours.) |
1198 | 1199 | self._levels = list(self.levels) |
1199 | | - |
| 1200 | + pdb.set_trace() |
1200 | 1201 | if self.extend in ('both', 'min'): |
1201 | 1202 | self._levels.insert(0, min(self.levels[0], self.zmin) - 1) |
1202 | 1203 | if self.extend in ('both', 'max'): |
@@ -1495,18 +1496,24 @@ def _contour_args(self, args, kwargs): |
1495 | 1496 | (fn, fn)) |
1496 | 1497 |
|
1497 | 1498 | # Check for vmin and vmax values and max out z values accordingly |
| 1499 | + # want zmax and zmin to be able to be outside data range, according to input vmin/vmax |
1498 | 1500 | if 'vmax' in kwargs: |
1499 | | - vmax = kwargs.pop('vmax') |
| 1501 | + vmax = kwargs['vmax'] |
1500 | 1502 | ind = z > vmax |
1501 | 1503 | z[ind] = vmax |
| 1504 | + self.zmax = kwargs.pop('vmax') |
| 1505 | + else: |
| 1506 | + self.zmax = ma.maximum(z) |
1502 | 1507 | if 'vmin' in kwargs: |
1503 | | - vmin = kwargs.pop('vmin') |
| 1508 | + vmin = kwargs['vmin'] |
1504 | 1509 | ind = z < vmin |
1505 | 1510 | z[ind] = vmin |
| 1511 | + self.zmin = kwargs.pop('vmin') |
| 1512 | + else: |
| 1513 | + self.zmin = ma.minimum(z) |
1506 | 1514 |
|
1507 | 1515 | z = ma.masked_invalid(z, copy=False) |
1508 | | - self.zmax = ma.maximum(z) |
1509 | | - self.zmin = ma.minimum(z) |
| 1516 | + |
1510 | 1517 | if self.logscale and self.zmin <= 0: |
1511 | 1518 | z = ma.masked_where(z <= 0, z) |
1512 | 1519 | warnings.warn('Log scale: values of z <= 0 have been masked') |
|
0 commit comments