Skip to content

Commit 7476f6f

Browse files
committed
Remove Artist.{get,set}_axes.
They are deprecated, and have been planned for removal in 2.0.
1 parent a67b232 commit 7476f6f

File tree

5 files changed

+19
-63
lines changed

5 files changed

+19
-63
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Removal of deprecated methods
2+
`````````````````````````````
3+
The deprecated `Artist.get_axes` and `Artist.set_axes` methods have been
4+
removed

doc/api/artist_api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ Figure and Axes
126126
Artist.remove
127127

128128
Artist.axes
129-
Artist.get_axes
130-
Artist.set_axes
131129

132130
Artist.set_figure
133131
Artist.get_figure

doc/api/axes_api.rst

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -581,44 +581,41 @@ General Artist Properties
581581
:template: autosummary.rst
582582
:nosignatures:
583583

584+
Axes.set_agg_filter
584585
Axes.set_alpha
585586
Axes.set_animated
586587
Axes.set_clip_box
587588
Axes.set_clip_on
588589
Axes.set_clip_path
589590
Axes.set_gid
590591
Axes.set_label
591-
Axes.set_url
592-
Axes.set_visible
593-
Axes.set_zorder
592+
Axes.set_path_effects
594593
Axes.set_rasterized
595594
Axes.set_sketch_params
596-
Axes.set_agg_filter
597595
Axes.set_snap
598596
Axes.set_transform
599-
Axes.set_path_effects
597+
Axes.set_url
598+
Axes.set_visible
599+
Axes.set_zorder
600600

601601
Axes.get_agg_filter
602-
Axes.get_sketch_params
603602
Axes.get_alpha
604603
Axes.get_animated
605604
Axes.get_clip_box
606605
Axes.get_clip_on
607606
Axes.get_clip_path
608607
Axes.get_gid
609608
Axes.get_label
609+
Axes.get_path_effects
610+
Axes.get_rasterized
611+
Axes.get_sketch_params
612+
Axes.get_snap
613+
Axes.get_transform
610614
Axes.get_url
611615
Axes.get_visible
612616
Axes.get_zorder
613-
Axes.get_rasterized
614-
Axes.get_transform
615-
Axes.get_snap
616-
Axes.get_path_effects
617-
618617

619618
Axes.axes
620-
Axes.get_axes
621-
Axes.set_axes
622619
Axes.set_figure
623620
Axes.get_figure
624621

doc/api/axis_api.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ Ticks
481481
Tick.get_agg_filter
482482
Tick.get_alpha
483483
Tick.get_animated
484-
Tick.get_axes
485484
Tick.get_children
486485
Tick.get_clip_box
487486
Tick.get_clip_on
@@ -517,7 +516,6 @@ Ticks
517516
Tick.set_agg_filter
518517
Tick.set_alpha
519518
Tick.set_animated
520-
Tick.set_axes
521519
Tick.set_clip_box
522520
Tick.set_clip_on
523521
Tick.set_clip_path
@@ -551,7 +549,6 @@ Ticks
551549
XTick.get_agg_filter
552550
XTick.get_alpha
553551
XTick.get_animated
554-
XTick.get_axes
555552
XTick.get_children
556553
XTick.get_clip_box
557554
XTick.get_clip_on
@@ -587,7 +584,6 @@ Ticks
587584
XTick.set_agg_filter
588585
XTick.set_alpha
589586
XTick.set_animated
590-
XTick.set_axes
591587
XTick.set_clip_box
592588
XTick.set_clip_on
593589
XTick.set_clip_path
@@ -621,7 +617,6 @@ Ticks
621617
YTick.get_agg_filter
622618
YTick.get_alpha
623619
YTick.get_animated
624-
YTick.get_axes
625620
YTick.get_children
626621
YTick.get_clip_box
627622
YTick.get_clip_on
@@ -657,7 +652,6 @@ Ticks
657652
YTick.set_agg_filter
658653
YTick.set_alpha
659654
YTick.set_animated
660-
YTick.set_axes
661655
YTick.set_clip_box
662656
YTick.set_clip_on
663657
YTick.set_clip_path
@@ -701,7 +695,6 @@ Axis
701695
Axis.get_agg_filter
702696
Axis.get_alpha
703697
Axis.get_animated
704-
Axis.get_axes
705698
Axis.get_children
706699
Axis.get_clip_box
707700
Axis.get_clip_on
@@ -737,7 +730,6 @@ Axis
737730
Axis.set_agg_filter
738731
Axis.set_alpha
739732
Axis.set_animated
740-
Axis.set_axes
741733
Axis.set_clip_box
742734
Axis.set_clip_on
743735
Axis.set_clip_path
@@ -771,7 +763,6 @@ Axis
771763
XAxis.get_agg_filter
772764
XAxis.get_alpha
773765
XAxis.get_animated
774-
XAxis.get_axes
775766
XAxis.get_children
776767
XAxis.get_clip_box
777768
XAxis.get_clip_on
@@ -807,7 +798,6 @@ Axis
807798
XAxis.set_agg_filter
808799
XAxis.set_alpha
809800
XAxis.set_animated
810-
XAxis.set_axes
811801
XAxis.set_clip_box
812802
XAxis.set_clip_on
813803
XAxis.set_clip_path
@@ -841,7 +831,6 @@ Axis
841831
YAxis.get_agg_filter
842832
YAxis.get_alpha
843833
YAxis.get_animated
844-
YAxis.get_axes
845834
YAxis.get_children
846835
YAxis.get_clip_box
847836
YAxis.get_clip_on
@@ -877,7 +866,6 @@ Axis
877866
YAxis.set_agg_filter
878867
YAxis.set_alpha
879868
YAxis.set_animated
880-
YAxis.set_axes
881869
YAxis.set_clip_box
882870
YAxis.set_clip_on
883871
YAxis.set_clip_path

lib/matplotlib/artist.py

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import numpy as np
1111
import matplotlib
1212
import matplotlib.cbook as cbook
13-
from matplotlib.cbook import mplDeprecation
1413
from matplotlib import docstring, rcParams
1514
from .transforms import (Bbox, IdentityTransform, TransformedBbox,
1615
TransformedPatchPath, TransformedPath, Transform)
@@ -207,32 +206,6 @@ def convert_yunits(self, y):
207206
return y
208207
return ax.yaxis.convert_units(y)
209208

210-
def set_axes(self, axes):
211-
"""
212-
Set the :class:`~matplotlib.axes.Axes` instance in which the
213-
artist resides, if any.
214-
215-
This has been deprecated in mpl 1.5, please use the
216-
axes property. Will be removed in 1.7 or 2.0.
217-
218-
ACCEPTS: an :class:`~matplotlib.axes.Axes` instance
219-
"""
220-
warnings.warn(_get_axes_msg.format('set_axes'), mplDeprecation,
221-
stacklevel=1)
222-
self.axes = axes
223-
224-
def get_axes(self):
225-
"""
226-
Return the :class:`~matplotlib.axes.Axes` instance the artist
227-
resides in, or *None*.
228-
229-
This has been deprecated in mpl 1.5, please use the
230-
axes property. Will be removed in 1.7 or 2.0.
231-
"""
232-
warnings.warn(_get_axes_msg.format('get_axes'), mplDeprecation,
233-
stacklevel=1)
234-
return self.axes
235-
236209
@property
237210
def axes(self):
238211
"""
@@ -243,18 +216,14 @@ def axes(self):
243216

244217
@axes.setter
245218
def axes(self, new_axes):
246-
247-
if (new_axes is not None and
248-
(self._axes is not None and new_axes != self._axes)):
249-
raise ValueError("Can not reset the axes. You are "
250-
"probably trying to re-use an artist "
251-
"in more than one Axes which is not "
252-
"supported")
253-
219+
if (new_axes is not None and self._axes is not None
220+
and new_axes != self._axes):
221+
raise ValueError("Can not reset the axes. You are probably "
222+
"trying to re-use an artist in more than one "
223+
"Axes which is not supported")
254224
self._axes = new_axes
255225
if new_axes is not None and new_axes is not self:
256226
self.stale_callback = _stale_axes_callback
257-
258227
return new_axes
259228

260229
@property

0 commit comments

Comments
 (0)