Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b528cee

Browse files
committed
Remove deprecated ContourSet.{vmin,vmax}.
1 parent e95572c commit b528cee

2 files changed

Lines changed: 0 additions & 39 deletions

File tree

lib/matplotlib/contour.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import matplotlib.patches as mpatches
2626
import matplotlib.texmanager as texmanager
2727
import matplotlib.transforms as mtransforms
28-
from matplotlib.cbook import mplDeprecation
2928

3029
# Import needed for adding manual selection capability to clabel
3130
from matplotlib.blocking_input import BlockingContourLabeler
@@ -1172,20 +1171,6 @@ def _contour_level_args(self, z, args):
11721171
if len(self.levels) > 1 and np.min(np.diff(self.levels)) <= 0.0:
11731172
raise ValueError("Contour levels must be increasing")
11741173

1175-
@property
1176-
def vmin(self):
1177-
warnings.warn("vmin is deprecated and will be removed in 2.2 "
1178-
"and not replaced.",
1179-
mplDeprecation)
1180-
return getattr(self, '_vmin', None)
1181-
1182-
@property
1183-
def vmax(self):
1184-
warnings.warn("vmax is deprecated and will be removed in 2.2 "
1185-
"and not replaced.",
1186-
mplDeprecation)
1187-
return getattr(self, '_vmax', None)
1188-
11891174
def _process_levels(self):
11901175
"""
11911176
Assign values to :attr:`layers` based on :attr:`levels`,
@@ -1195,10 +1180,6 @@ def _process_levels(self):
11951180
a line is a thin layer. No extended levels are needed
11961181
with line contours.
11971182
"""
1198-
# following are deprecated and will be removed in 2.2
1199-
self._vmin = np.min(self.levels)
1200-
self._vmax = np.max(self.levels)
1201-
12021183
# Make a private _levels to include extended regions; we
12031184
# want to leave the original levels attribute unchanged.
12041185
# (Colorbar needs this even for line contours.)

lib/matplotlib/tests/test_contour.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -305,26 +305,6 @@ def test_contourf_decreasing_levels():
305305
plt.contourf(z, [1.0, 0.0])
306306

307307

308-
def test_vminvmax_warning():
309-
z = [[0.1, 0.3], [0.5, 0.7]]
310-
plt.figure()
311-
cs = plt.contourf(z, [0.0, 1.0])
312-
313-
with warnings.catch_warnings(record=True) as w:
314-
warnings.simplefilter("always")
315-
cs.vmin
316-
assert len(w) == 1
317-
msg = "vmin is deprecated and will be removed in 2.2 "
318-
assert str(w[0].message).startswith(msg)
319-
320-
with warnings.catch_warnings(record=True) as w:
321-
warnings.simplefilter("always")
322-
cs.vmax
323-
assert len(w) == 1
324-
msg = "vmax is deprecated and will be removed in 2.2 "
325-
assert str(w[0].message).startswith(msg)
326-
327-
328308
def test_contourf_symmetric_locator():
329309
# github issue 7271
330310
z = np.arange(12).reshape((3, 4))

0 commit comments

Comments
 (0)