@@ -52,13 +52,17 @@ def pick(self, mouseevent):
5252@functools .lru_cache (None )
5353def parasite_axes_class_factory (axes_class = None ):
5454 if axes_class is None :
55+ cbook .warn_deprecated (
56+ "3.3" , message = "Support for passing None to "
57+ "parasite_axes_class_factory is deprecated; explicitly pass the "
58+ "default Axes class instead." )
5559 axes_class = Axes
5660
5761 return type ("%sParasite" % axes_class .__name__ ,
5862 (ParasiteAxesBase , axes_class ), {})
5963
6064
61- ParasiteAxes = parasite_axes_class_factory ()
65+ ParasiteAxes = parasite_axes_class_factory (Axes )
6266
6367
6468class ParasiteAxesAuxTransBase :
@@ -175,6 +179,10 @@ def apply_aspect(self, position=None):
175179@functools .lru_cache (None )
176180def parasite_axes_auxtrans_class_factory (axes_class = None ):
177181 if axes_class is None :
182+ cbook .warn_deprecated (
183+ "3.3" , message = "Support for passing None to "
184+ "parasite_axes_auxtrans_class_factory is deprecated; explicitly "
185+ "pass the default ParasiteAxes class instead." )
178186 parasite_axes_class = ParasiteAxes
179187 elif not issubclass (axes_class , ParasiteAxesBase ):
180188 parasite_axes_class = parasite_axes_class_factory (axes_class )
@@ -185,16 +193,15 @@ def parasite_axes_auxtrans_class_factory(axes_class=None):
185193 {'name' : 'parasite_axes' })
186194
187195
188- ParasiteAxesAuxTrans = parasite_axes_auxtrans_class_factory (
189- axes_class = ParasiteAxes )
196+ ParasiteAxesAuxTrans = parasite_axes_auxtrans_class_factory (ParasiteAxes )
190197
191198
192199class HostAxesBase :
193200 def __init__ (self , * args , ** kwargs ):
194201 self .parasites = []
195202 super ().__init__ (* args , ** kwargs )
196203
197- def get_aux_axes (self , tr , viewlim_mode = "equal" , axes_class = None ):
204+ def get_aux_axes (self , tr , viewlim_mode = "equal" , axes_class = ParasiteAxes ):
198205 parasite_axes_class = parasite_axes_auxtrans_class_factory (axes_class )
199206 ax2 = parasite_axes_class (self , tr , viewlim_mode )
200207 # note that ax2.transData == tr + ax1.transData
@@ -354,6 +361,9 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
354361@functools .lru_cache (None )
355362def host_axes_class_factory (axes_class = None ):
356363 if axes_class is None :
364+ cbook .warn_deprecated (
365+ "3.3" , message = "Support for passing None to host_axes_class is "
366+ "deprecated; explicitly pass the default Axes class instead." )
357367 axes_class = Axes
358368
359369 def _get_base_axes (self ):
@@ -365,16 +375,16 @@ def _get_base_axes(self):
365375
366376
367377def host_subplot_class_factory (axes_class ):
368- host_axes_class = host_axes_class_factory (axes_class = axes_class )
378+ host_axes_class = host_axes_class_factory (axes_class )
369379 subplot_host_class = subplot_class_factory (host_axes_class )
370380 return subplot_host_class
371381
372382
373- HostAxes = host_axes_class_factory (axes_class = Axes )
383+ HostAxes = host_axes_class_factory (Axes )
374384SubplotHost = subplot_class_factory (HostAxes )
375385
376386
377- def host_axes (* args , axes_class = None , figure = None , ** kwargs ):
387+ def host_axes (* args , axes_class = Axes , figure = None , ** kwargs ):
378388 """
379389 Create axes that can act as a hosts to parasitic axes.
380390
@@ -397,7 +407,7 @@ def host_axes(*args, axes_class=None, figure=None, **kwargs):
397407 return ax
398408
399409
400- def host_subplot (* args , axes_class = None , figure = None , ** kwargs ):
410+ def host_subplot (* args , axes_class = Axes , figure = None , ** kwargs ):
401411 """
402412 Create a subplot that can act as a host to parasitic axes.
403413
0 commit comments