1
1
import matplotlib as mpl
2
- from matplotlib import _api , cbook
2
+ from matplotlib import cbook
3
3
from matplotlib .axes ._axes import Axes
4
- from matplotlib .gridspec import GridSpec , SubplotSpec
4
+ from matplotlib .gridspec import SubplotSpec
5
5
6
6
7
7
class SubplotBase :
@@ -35,22 +35,6 @@ def __init__(self, fig, *args, **kwargs):
35
35
# This will also update the axes position.
36
36
self .set_subplotspec (SubplotSpec ._from_subplot_args (fig , args ))
37
37
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
-
54
38
def get_subplotspec (self ):
55
39
"""Return the `.SubplotSpec` instance associated with the subplot."""
56
40
return self ._subplotspec
@@ -64,44 +48,6 @@ def get_gridspec(self):
64
48
"""Return the `.GridSpec` instance associated with the subplot."""
65
49
return self ._subplotspec .get_gridspec ()
66
50
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
-
105
51
def label_outer (self ):
106
52
"""
107
53
Only show "outer" labels and tick labels.
0 commit comments