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

Skip to content

Commit 94d6b42

Browse files
committed
Replaced DeprecationWarnings with mplDeprecation warnigns
1 parent e033427 commit 94d6b42

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/matplotlib/axes.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import matplotlib
1111
rcParams = matplotlib.rcParams
1212

13-
from matplotlib import MatplotlibDeprecationWarning as MDeprecation
14-
1513
import matplotlib.artist as martist
1614
from matplotlib.artist import allow_rasterization
1715
import matplotlib.axis as maxis
@@ -1053,8 +1051,8 @@ def set_aspect(self, aspect, adjustable=None, anchor=None):
10531051
the option 'normal' for aspect is deprecated. Use 'auto' instead.
10541052
"""
10551053
if aspect == 'normal':
1056-
raise MDeprecation("Use 'auto' instead of 'normal' for "
1057-
"aspect. Will be removed in 1.4.x")
1054+
warnings.warn("Use 'auto' instead of 'normal' for aspect. Will "
1055+
"be removed in 1.4.x", mplDeprecation)
10581056
self._aspect = 'auto'
10591057

10601058
elif aspect in ('equal', 'auto'):
@@ -7264,8 +7262,8 @@ def pcolor(self, *args, **kwargs):
72647262
vmin = kwargs.pop('vmin', None)
72657263
vmax = kwargs.pop('vmax', None)
72667264
if 'shading' in kwargs:
7267-
raise DeprecationWarning("Use edgecolors instead of shading. "
7268-
"Will be removed in 1.4")
7265+
warnings.warn("Use edgecolors instead of shading. "
7266+
"Will be removed in 1.4", mplDeprecation)
72697267
shading = kwargs.pop('shading', 'flat')
72707268

72717269
X, Y, C = self._pcolorargs('pcolor', *args)
@@ -7310,7 +7308,6 @@ def pcolor(self, *args, **kwargs):
73107308
kwargs['linewidths'] = kwargs.pop('linewidth')
73117309
kwargs.setdefault('linewidths', linewidths)
73127310

7313-
73147311
if shading == 'faceted':
73157312
edgecolors = 'k',
73167313
else:
@@ -7320,7 +7317,6 @@ def pcolor(self, *args, **kwargs):
73207317
kwargs['edgecolors'] = kwargs.pop('edgecolor')
73217318
ec = kwargs.setdefault('edgecolors', edgecolors)
73227319

7323-
73247320
# aa setting will default via collections to patch.antialiased
73257321
# unless the boundary is not stroked, in which case the
73267322
# default will be False; with unstroked boundaries, aa

0 commit comments

Comments
 (0)