@@ -52,13 +52,17 @@ def pick(self, mouseevent):
52
52
@functools .lru_cache (None )
53
53
def parasite_axes_class_factory (axes_class = None ):
54
54
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." )
55
59
axes_class = Axes
56
60
57
61
return type ("%sParasite" % axes_class .__name__ ,
58
62
(ParasiteAxesBase , axes_class ), {})
59
63
60
64
61
- ParasiteAxes = parasite_axes_class_factory ()
65
+ ParasiteAxes = parasite_axes_class_factory (Axes )
62
66
63
67
64
68
class ParasiteAxesAuxTransBase :
@@ -175,6 +179,10 @@ def apply_aspect(self, position=None):
175
179
@functools .lru_cache (None )
176
180
def parasite_axes_auxtrans_class_factory (axes_class = None ):
177
181
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." )
178
186
parasite_axes_class = ParasiteAxes
179
187
elif not issubclass (axes_class , ParasiteAxesBase ):
180
188
parasite_axes_class = parasite_axes_class_factory (axes_class )
@@ -185,16 +193,15 @@ def parasite_axes_auxtrans_class_factory(axes_class=None):
185
193
{'name' : 'parasite_axes' })
186
194
187
195
188
- ParasiteAxesAuxTrans = parasite_axes_auxtrans_class_factory (
189
- axes_class = ParasiteAxes )
196
+ ParasiteAxesAuxTrans = parasite_axes_auxtrans_class_factory (ParasiteAxes )
190
197
191
198
192
199
class HostAxesBase :
193
200
def __init__ (self , * args , ** kwargs ):
194
201
self .parasites = []
195
202
super ().__init__ (* args , ** kwargs )
196
203
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 ):
198
205
parasite_axes_class = parasite_axes_auxtrans_class_factory (axes_class )
199
206
ax2 = parasite_axes_class (self , tr , viewlim_mode )
200
207
# note that ax2.transData == tr + ax1.transData
@@ -354,6 +361,9 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
354
361
@functools .lru_cache (None )
355
362
def host_axes_class_factory (axes_class = None ):
356
363
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." )
357
367
axes_class = Axes
358
368
359
369
def _get_base_axes (self ):
@@ -365,16 +375,16 @@ def _get_base_axes(self):
365
375
366
376
367
377
def 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 )
369
379
subplot_host_class = subplot_class_factory (host_axes_class )
370
380
return subplot_host_class
371
381
372
382
373
- HostAxes = host_axes_class_factory (axes_class = Axes )
383
+ HostAxes = host_axes_class_factory (Axes )
374
384
SubplotHost = subplot_class_factory (HostAxes )
375
385
376
386
377
- def host_axes (* args , axes_class = None , figure = None , ** kwargs ):
387
+ def host_axes (* args , axes_class = Axes , figure = None , ** kwargs ):
378
388
"""
379
389
Create axes that can act as a hosts to parasitic axes.
380
390
@@ -397,7 +407,7 @@ def host_axes(*args, axes_class=None, figure=None, **kwargs):
397
407
return ax
398
408
399
409
400
- def host_subplot (* args , axes_class = None , figure = None , ** kwargs ):
410
+ def host_subplot (* args , axes_class = Axes , figure = None , ** kwargs ):
401
411
"""
402
412
Create a subplot that can act as a host to parasitic axes.
403
413
0 commit comments