11import matplotlib as mpl
2- from matplotlib import _api , cbook
2+ from matplotlib import cbook
33from matplotlib .axes ._axes import Axes
4- from matplotlib .gridspec import GridSpec , SubplotSpec
4+ from matplotlib .gridspec import SubplotSpec
55
66
77class SubplotBase :
@@ -35,22 +35,6 @@ def __init__(self, fig, *args, **kwargs):
3535 # This will also update the axes position.
3636 self .set_subplotspec (SubplotSpec ._from_subplot_args (fig , args ))
3737
38- @_api .deprecated (
39- "3.4" , alternative = "get_subplotspec" ,
40- addendum = "(get_subplotspec returns a SubplotSpec instance.)" )
41- def get_geometry (self ):
42- """Get the subplot geometry, e.g., (2, 2, 3)."""
43- rows , cols , num1 , num2 = self .get_subplotspec ().get_geometry ()
44- return rows , cols , num1 + 1 # for compatibility
45-
46- @_api .deprecated ("3.4" , alternative = "set_subplotspec" )
47- def change_geometry (self , numrows , numcols , num ):
48- """Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3)."""
49- self ._subplotspec = GridSpec (numrows , numcols ,
50- figure = self .figure )[num - 1 ]
51- self .update_params ()
52- self .set_position (self .figbox )
53-
5438 def get_subplotspec (self ):
5539 """Return the `.SubplotSpec` instance associated with the subplot."""
5640 return self ._subplotspec
@@ -64,44 +48,6 @@ def get_gridspec(self):
6448 """Return the `.GridSpec` instance associated with the subplot."""
6549 return self ._subplotspec .get_gridspec ()
6650
67- @_api .deprecated (
68- "3.4" , alternative = "get_position()" )
69- @property
70- def figbox (self ):
71- return self .get_position ()
72-
73- @_api .deprecated ("3.4" , alternative = "get_gridspec().nrows" )
74- @property
75- def numRows (self ):
76- return self .get_gridspec ().nrows
77-
78- @_api .deprecated ("3.4" , alternative = "get_gridspec().ncols" )
79- @property
80- def numCols (self ):
81- return self .get_gridspec ().ncols
82-
83- @_api .deprecated ("3.4" )
84- def update_params (self ):
85- """Update the subplot position from ``self.figure.subplotpars``."""
86- # Now a no-op, as figbox/numRows/numCols are (deprecated) auto-updating
87- # properties.
88-
89- @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_first_row()" )
90- def is_first_row (self ):
91- return self .get_subplotspec ().rowspan .start == 0
92-
93- @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_last_row()" )
94- def is_last_row (self ):
95- return self .get_subplotspec ().rowspan .stop == self .get_gridspec ().nrows
96-
97- @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_first_col()" )
98- def is_first_col (self ):
99- return self .get_subplotspec ().colspan .start == 0
100-
101- @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_last_col()" )
102- def is_last_col (self ):
103- return self .get_subplotspec ().colspan .stop == self .get_gridspec ().ncols
104-
10551 def label_outer (self ):
10652 """
10753 Only show "outer" labels and tick labels.
0 commit comments