|
37 | 37 | import matplotlib.ticker as mticker |
38 | 38 | import matplotlib.transforms as mtransforms |
39 | 39 | import matplotlib.tri as mtri |
| 40 | +from matplotlib import MatplotlibDeprecationWarning as mDeprecation |
40 | 41 | from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer |
41 | 42 |
|
42 | 43 | iterable = cbook.iterable |
@@ -154,8 +155,7 @@ def set_default_color_cycle(clist): |
154 | 155 |
|
155 | 156 | """ |
156 | 157 | rcParams['axes.color_cycle'] = clist |
157 | | - warnings.warn("Set rcParams['axes.color_cycle'] directly", |
158 | | - DeprecationWarning) |
| 158 | + warnings.warn("Set rcParams['axes.color_cycle'] directly", mDeprecation) |
159 | 159 |
|
160 | 160 |
|
161 | 161 | class _process_plot_var_args(object): |
@@ -1376,11 +1376,11 @@ def get_child_artists(self): |
1376 | 1376 |
|
1377 | 1377 | .. deprecated:: 0.98 |
1378 | 1378 | """ |
1379 | | - raise DeprecationWarning('Use get_children instead') |
| 1379 | + raise mDeprecation('Use get_children instead') |
1380 | 1380 |
|
1381 | 1381 | def get_frame(self): |
1382 | 1382 | """Return the axes Rectangle frame""" |
1383 | | - warnings.warn('use ax.patch instead', DeprecationWarning) |
| 1383 | + warnings.warn('use ax.patch instead', mDeprecation) |
1384 | 1384 | return self.patch |
1385 | 1385 |
|
1386 | 1386 | def get_legend(self): |
@@ -3135,12 +3135,12 @@ def connect(self, s, func): |
3135 | 3135 | disconnect to disconnect from the axes event |
3136 | 3136 |
|
3137 | 3137 | """ |
3138 | | - raise DeprecationWarning('use the callbacks CallbackRegistry instance ' |
| 3138 | + raise mDeprecation('use the callbacks CallbackRegistry instance ' |
3139 | 3139 | 'instead') |
3140 | 3140 |
|
3141 | 3141 | def disconnect(self, cid): |
3142 | 3142 | """disconnect from the Axes event.""" |
3143 | | - raise DeprecationWarning('use the callbacks CallbackRegistry instance ' |
| 3143 | + raise mDeprecation('use the callbacks CallbackRegistry instance ' |
3144 | 3144 | 'instead') |
3145 | 3145 |
|
3146 | 3146 | def get_children(self): |
@@ -3192,7 +3192,7 @@ def pick(self, *args): |
3192 | 3192 | the artist and the artist has picker set |
3193 | 3193 | """ |
3194 | 3194 | if len(args) > 1: |
3195 | | - raise DeprecationWarning('New pick API implemented -- ' |
| 3195 | + raise mDeprecation('New pick API implemented -- ' |
3196 | 3196 | 'see API_CHANGES in the src distribution') |
3197 | 3197 | martist.Artist.pick(self, args[0]) |
3198 | 3198 |
|
@@ -3760,7 +3760,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid', |
3760 | 3760 | .. plot:: mpl_examples/pylab_examples/hline_demo.py |
3761 | 3761 | """ |
3762 | 3762 | if kwargs.get('fmt') is not None: |
3763 | | - raise DeprecationWarning('hlines now uses a ' |
| 3763 | + raise mDeprecation('hlines now uses a ' |
3764 | 3764 | 'collections.LineCollection and not a ' |
3765 | 3765 | 'list of Line2D to draw; see API_CHANGES') |
3766 | 3766 |
|
@@ -3842,7 +3842,7 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid', |
3842 | 3842 | """ |
3843 | 3843 |
|
3844 | 3844 | if kwargs.get('fmt') is not None: |
3845 | | - raise DeprecationWarning('vlines now uses a ' |
| 3845 | + raise mDeprecation('vlines now uses a ' |
3846 | 3846 | 'collections.LineCollection and not a ' |
3847 | 3847 | 'list of Line2D to draw; see API_CHANGES') |
3848 | 3848 |
|
@@ -6143,7 +6143,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, |
6143 | 6143 | edgecolors = 'none' |
6144 | 6144 | warnings.warn( |
6145 | 6145 | '''replace "faceted=False" with "edgecolors='none'"''', |
6146 | | - DeprecationWarning) # 2008/04/18 |
| 6146 | + mDeprecation) # 2008/04/18 |
6147 | 6147 |
|
6148 | 6148 | # to be API compatible |
6149 | 6149 | if marker is None and not (verts is None): |
@@ -8064,7 +8064,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, |
8064 | 8064 |
|
8065 | 8065 |
|
8066 | 8066 | if kwargs.get('width') is not None: |
8067 | | - raise DeprecationWarning( |
| 8067 | + raise mDeprecation( |
8068 | 8068 | 'hist now uses the rwidth to give relative width ' |
8069 | 8069 | 'and not absolute width') |
8070 | 8070 |
|
@@ -8783,7 +8783,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None, |
8783 | 8783 | """ |
8784 | 8784 | if precision is None: |
8785 | 8785 | precision = 0 |
8786 | | - warnings.DeprecationWarning("Use precision=0 instead of None") |
| 8786 | + warnings.warn("Use precision=0 instead of None", mDeprecation) |
8787 | 8787 | # 2008/10/03 |
8788 | 8788 | if marker is None and markersize is None and hasattr(Z, 'tocoo'): |
8789 | 8789 | marker = 's' |
|
0 commit comments