1- import functools
2-
31from matplotlib import _api , cbook
42import matplotlib .artist as martist
53import matplotlib .image as mimage
@@ -71,10 +69,6 @@ def set_viewlim_mode(self, mode):
7169 def get_viewlim_mode (self ):
7270 return self ._viewlim_mode
7371
74- @_api .deprecated ("3.4" , alternative = "apply_aspect" )
75- def update_viewlim (self ):
76- return self ._update_viewlim
77-
7872 def _update_viewlim (self ): # Inline after deprecation elapses.
7973 viewlim = self ._parent_axes .viewLim .frozen ()
8074 mode = self .get_viewlim_mode ()
@@ -100,68 +94,6 @@ def apply_aspect(self, position=None):
10094ParasiteAxes = parasite_axes_class_factory (Axes )
10195
10296
103- @_api .deprecated ("3.4" , alternative = "ParasiteAxesBase" )
104- class ParasiteAxesAuxTransBase :
105- def __init__ (self , parent_axes , aux_transform , viewlim_mode = None ,
106- ** kwargs ):
107- # Explicit wrapper for deprecation to work.
108- super ().__init__ (parent_axes , aux_transform ,
109- viewlim_mode = viewlim_mode , ** kwargs )
110-
111- def _set_lim_and_transforms (self ):
112- self .transAxes = self ._parent_axes .transAxes
113- self .transData = self .transAux + self ._parent_axes .transData
114- self ._xaxis_transform = mtransforms .blended_transform_factory (
115- self .transData , self .transAxes )
116- self ._yaxis_transform = mtransforms .blended_transform_factory (
117- self .transAxes , self .transData )
118-
119- def set_viewlim_mode (self , mode ):
120- _api .check_in_list ([None , "equal" , "transform" ], mode = mode )
121- self ._viewlim_mode = mode
122-
123- def get_viewlim_mode (self ):
124- return self ._viewlim_mode
125-
126- @_api .deprecated ("3.4" , alternative = "apply_aspect" )
127- def update_viewlim (self ):
128- return self ._update_viewlim ()
129-
130- def _update_viewlim (self ): # Inline after deprecation elapses.
131- viewlim = self ._parent_axes .viewLim .frozen ()
132- mode = self .get_viewlim_mode ()
133- if mode is None :
134- pass
135- elif mode == "equal" :
136- self .axes .viewLim .set (viewlim )
137- elif mode == "transform" :
138- self .axes .viewLim .set (
139- viewlim .transformed (self .transAux .inverted ()))
140- else :
141- _api .check_in_list ([None , "equal" , "transform" ], mode = mode )
142-
143- def apply_aspect (self , position = None ):
144- self ._update_viewlim ()
145- super ().apply_aspect ()
146-
147-
148- @_api .deprecated ("3.4" , alternative = "parasite_axes_class_factory" )
149- @functools .lru_cache (None )
150- def parasite_axes_auxtrans_class_factory (axes_class ):
151- if not issubclass (axes_class , ParasiteAxesBase ):
152- parasite_axes_class = parasite_axes_class_factory (axes_class )
153- else :
154- parasite_axes_class = axes_class
155- return type ("%sParasiteAuxTrans" % parasite_axes_class .__name__ ,
156- (ParasiteAxesAuxTransBase , parasite_axes_class ),
157- {'name' : 'parasite_axes' })
158-
159-
160- # Also deprecated.
161- with _api .suppress_matplotlib_deprecation_warning ():
162- ParasiteAxesAuxTrans = parasite_axes_auxtrans_class_factory (ParasiteAxes )
163-
164-
16597class HostAxesBase :
16698 def __init__ (self , * args , ** kwargs ):
16799 self .parasites = []
0 commit comments