11import functools
22import uuid
33
4- from matplotlib import cbook , docstring
4+ from matplotlib import _api , cbook , docstring
55import matplotlib .artist as martist
66from matplotlib .axes ._axes import Axes
77from matplotlib .gridspec import GridSpec , SubplotSpec
@@ -47,15 +47,15 @@ def __reduce__(self):
4747 (axes_class ,),
4848 self .__getstate__ ())
4949
50- @cbook .deprecated (
50+ @_api .deprecated (
5151 "3.4" , alternative = "get_subplotspec" ,
5252 addendum = "(get_subplotspec returns a SubplotSpec instance.)" )
5353 def get_geometry (self ):
5454 """Get the subplot geometry, e.g., (2, 2, 3)."""
5555 rows , cols , num1 , num2 = self .get_subplotspec ().get_geometry ()
5656 return rows , cols , num1 + 1 # for compatibility
5757
58- @cbook .deprecated ("3.4" , alternative = "set_subplotspec" )
58+ @_api .deprecated ("3.4" , alternative = "set_subplotspec" )
5959 def change_geometry (self , numrows , numcols , num ):
6060 """Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3)."""
6161 self ._subplotspec = GridSpec (numrows , numcols ,
@@ -76,51 +76,51 @@ def get_gridspec(self):
7676 """Return the `.GridSpec` instance associated with the subplot."""
7777 return self ._subplotspec .get_gridspec ()
7878
79- @cbook .deprecated (
79+ @_api .deprecated (
8080 "3.4" , alternative = "get_subplotspec().get_position(self.figure)" )
8181 @property
8282 def figbox (self ):
8383 return self .get_subplotspec ().get_position (self .figure )
8484
85- @cbook .deprecated ("3.4" , alternative = "get_gridspec().nrows" )
85+ @_api .deprecated ("3.4" , alternative = "get_gridspec().nrows" )
8686 @property
8787 def numRows (self ):
8888 return self .get_gridspec ().nrows
8989
90- @cbook .deprecated ("3.4" , alternative = "get_gridspec().ncols" )
90+ @_api .deprecated ("3.4" , alternative = "get_gridspec().ncols" )
9191 @property
9292 def numCols (self ):
9393 return self .get_gridspec ().ncols
9494
95- @cbook .deprecated ("3.4" )
95+ @_api .deprecated ("3.4" )
9696 def update_params (self ):
9797 """Update the subplot position from ``self.figure.subplotpars``."""
9898 # Now a no-op, as figbox/numRows/numCols are (deprecated) auto-updating
9999 # properties.
100100
101- @cbook .deprecated ("3.2" , alternative = "ax.get_subplotspec().rowspan.start" )
101+ @_api .deprecated ("3.2" , alternative = "ax.get_subplotspec().rowspan.start" )
102102 @property
103103 def rowNum (self ):
104104 return self .get_subplotspec ().rowspan .start
105105
106- @cbook .deprecated ("3.2" , alternative = "ax.get_subplotspec().colspan.start" )
106+ @_api .deprecated ("3.2" , alternative = "ax.get_subplotspec().colspan.start" )
107107 @property
108108 def colNum (self ):
109109 return self .get_subplotspec ().colspan .start
110110
111- @cbook .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_first_row()" )
111+ @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_first_row()" )
112112 def is_first_row (self ):
113113 return self .get_subplotspec ().rowspan .start == 0
114114
115- @cbook .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_last_row()" )
115+ @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_last_row()" )
116116 def is_last_row (self ):
117117 return self .get_subplotspec ().rowspan .stop == self .get_gridspec ().nrows
118118
119- @cbook .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_first_col()" )
119+ @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_first_col()" )
120120 def is_first_col (self ):
121121 return self .get_subplotspec ().colspan .start == 0
122122
123- @cbook .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_last_col()" )
123+ @_api .deprecated ("3.4" , alternative = "ax.get_subplotspec().is_last_col()" )
124124 def is_last_col (self ):
125125 return self .get_subplotspec ().colspan .stop == self .get_gridspec ().ncols
126126
0 commit comments