|
36 | 36 | import matplotlib.ticker as mticker |
37 | 37 | import matplotlib.transforms as mtransforms |
38 | 38 | import matplotlib.tri as mtri |
| 39 | +from matplotlib import MatplotlibDeprecationWarning as mDeprecation |
39 | 40 | from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer |
40 | 41 |
|
41 | 42 | iterable = cbook.iterable |
@@ -150,8 +151,7 @@ def set_default_color_cycle(clist): |
150 | 151 |
|
151 | 152 | """ |
152 | 153 | rcParams['axes.color_cycle'] = clist |
153 | | - warnings.warn("Set rcParams['axes.color_cycle'] directly", |
154 | | - DeprecationWarning) |
| 154 | + warnings.warn("Set rcParams['axes.color_cycle'] directly", mDeprecation) |
155 | 155 |
|
156 | 156 |
|
157 | 157 | 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): |
@@ -3112,13 +3112,13 @@ def connect(self, s, func): |
3112 | 3112 | disconnect to disconnect from the axes event |
3113 | 3113 |
|
3114 | 3114 | """ |
3115 | | - raise DeprecationWarning('use the callbacks CallbackRegistry instance ' |
3116 | | - 'instead') |
| 3115 | + raise mDeprecation('use the callbacks CallbackRegistry instance ' |
| 3116 | + 'instead') |
3117 | 3117 |
|
3118 | 3118 | def disconnect(self, cid): |
3119 | 3119 | """disconnect from the Axes event.""" |
3120 | | - raise DeprecationWarning('use the callbacks CallbackRegistry instance ' |
3121 | | - 'instead') |
| 3120 | + raise mDeprecation('use the callbacks CallbackRegistry instance ' |
| 3121 | + 'instead') |
3122 | 3122 |
|
3123 | 3123 | def get_children(self): |
3124 | 3124 | """return a list of child artists""" |
@@ -3167,10 +3167,10 @@ def pick(self, *args): |
3167 | 3167 | each child artist will fire a pick event if mouseevent is over |
3168 | 3168 | the artist and the artist has picker set |
3169 | 3169 | """ |
3170 | | - if len(args)>1: |
3171 | | - raise DeprecationWarning('New pick API implemented -- ' |
3172 | | - 'see API_CHANGES in the src distribution') |
3173 | | - martist.Artist.pick(self,args[0]) |
| 3170 | + if len(args) > 1: |
| 3171 | + raise mDeprecation('New pick API implemented -- ' |
| 3172 | + 'see API_CHANGES in the src distribution') |
| 3173 | + martist.Artist.pick(self, args[0]) |
3174 | 3174 |
|
3175 | 3175 | def __pick(self, x, y, trans=None, among=None): |
3176 | 3176 | """ |
@@ -3730,9 +3730,9 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid', |
3730 | 3730 | .. plot:: mpl_examples/pylab_examples/hline_demo.py |
3731 | 3731 | """ |
3732 | 3732 | if kwargs.get('fmt') is not None: |
3733 | | - raise DeprecationWarning('hlines now uses a ' |
3734 | | - 'collections.LineCollection and not a ' |
3735 | | - 'list of Line2D to draw; see API_CHANGES') |
| 3733 | + raise mDeprecation('hlines now uses a ' |
| 3734 | + 'collections.LineCollection and not a ' |
| 3735 | + 'list of Line2D to draw; see API_CHANGES') |
3736 | 3736 |
|
3737 | 3737 | # We do the conversion first since not all unitized data is uniform |
3738 | 3738 | # process the unit information |
@@ -3810,9 +3810,9 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid', |
3810 | 3810 | """ |
3811 | 3811 |
|
3812 | 3812 | if kwargs.get('fmt') is not None: |
3813 | | - raise DeprecationWarning('vlines now uses a ' |
3814 | | - 'collections.LineCollection and not a ' |
3815 | | - 'list of Line2D to draw; see API_CHANGES') |
| 3813 | + raise mDeprecation('vlines now uses a ' |
| 3814 | + 'collections.LineCollection and not a ' |
| 3815 | + 'list of Line2D to draw; see API_CHANGES') |
3816 | 3816 |
|
3817 | 3817 | self._process_unit_info(xdata=x, ydata=[ymin, ymax], kwargs=kwargs) |
3818 | 3818 |
|
@@ -6086,7 +6086,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, |
6086 | 6086 | edgecolors = 'none' |
6087 | 6087 | warnings.warn( |
6088 | 6088 | '''replace "faceted=False" with "edgecolors='none'"''', |
6089 | | - DeprecationWarning) #2008/04/18 |
| 6089 | + mDeprecation) # 2008/04/18 |
6090 | 6090 |
|
6091 | 6091 | sym = None |
6092 | 6092 | symstyle = 0 |
@@ -7999,7 +7999,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, |
7999 | 7999 |
|
8000 | 8000 |
|
8001 | 8001 | if kwargs.get('width') is not None: |
8002 | | - raise DeprecationWarning( |
| 8002 | + raise mDeprecation( |
8003 | 8003 | 'hist now uses the rwidth to give relative width ' |
8004 | 8004 | 'and not absolute width') |
8005 | 8005 |
|
@@ -8715,7 +8715,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None, |
8715 | 8715 | """ |
8716 | 8716 | if precision is None: |
8717 | 8717 | precision = 0 |
8718 | | - warnings.DeprecationWarning("Use precision=0 instead of None") |
| 8718 | + warnings.warn("Use precision=0 instead of None", mDeprecation) |
8719 | 8719 | # 2008/10/03 |
8720 | 8720 | if marker is None and markersize is None and hasattr(Z, 'tocoo'): |
8721 | 8721 | marker = 's' |
|
0 commit comments