8000 Adjustments to contour.py so that levels are set accordingly to input vmin and vmax, if provided, so color bar works correctly. by kthyng · Pull Request #2176 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Adjustments to contour.py so that levels are set accordingly to input vmin and vmax, if provided, so color bar works correctly. #2176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
switch calls for vmin and vmax through kwargs in _contour_args() to j…
…ust call and not pop out the arguments. Turns out it is not necessary to use extend, this will just happen on its own.
  • Loading branch information
kthyng committed Jun 28, 2013
commit f627dc711df5fc22772ec493796073770da64fdf
7 changes: 3 additions & 4 deletions lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import matplotlib.patches as mpatches
import matplotlib.texmanager as texmanager
import matplotlib.transforms as mtrans
import pdb

# Import needed for adding manual selection capability to clabel
from matplotlib.blocking_input import BlockingContourLabeler
Expand Down Expand Up @@ -1197,7 +1196,7 @@ def _process_levels(self):
# want to leave the original levels attribute unchanged.
# (Colorbar needs this even for line contours.)
self._levels = list(self.levels)
pdb.set_trace()

if self.extend in ('both', 'min'):
self._levels.insert(0, min(self.levels[0], self.zmin) - 1)
if self.extend in ('both', 'max'):
Expand Down Expand Up @@ -1501,14 +1500,14 @@ def _contour_args(self, args, kwargs):
vmax = kwargs['vmax']
ind = z > vmax
z[ind] = vmax
self.zmax = kwargs.pop('vmax')
self.zmax = kwargs['vmax']
else:
self.zmax = ma.maximum(z)
if 'vmin' in kwargs:
vmin = kwargs['vmin']
ind = z < vmin
z[ind] = vmin
self.zmin = kwargs.pop('vmin')
self.zmin = kwargs['vmin']
else:
self.zmin = ma.minimum(z)

Expand Down
0