@@ -99,20 +99,35 @@ def __init__(self, *args, **kwargs):
9999 self .parasites = []
100100 super ().__init__ (* args , ** kwargs )
101101
102- def get_aux_axes (self , tr = None , viewlim_mode = "equal" , axes_class = Axes ):
102+ def get_aux_axes (
103+ self , tr = None , viewlim_mode = "equal" , axes_class = None , ** kwargs ):
103104 """
104105 Add a parasite axes to this host.
105106
106107 Despite this method's name, this should actually be thought of as an
107108 ``add_parasite_axes`` method.
108109
109- *tr* may be `.Transform`, in which case the following relation will
110- hold: ``parasite.transData = tr + host.transData``. Alternatively, it
111- may be None (the default), no special relationship will hold between
112- the parasite's and the host's ``transData``.
110+ Parameters
111+ ----------
112+ tr : `.Transform` or None, default: None
113+ If a `.Transform`, the following relation will hold:
114+ ``parasite.transData = tr + host.transData``.
115+ If None, the parasite's and the host's ``transData`` are unrelated.
116+ viewlim_mode : {"equal", "transform", None}, default: "equal"
117+ How the parasite's view limits are set: directly equal to the
118+ parent axes ("equal"), equal after application of *tr*
119+ ("transform"), or independently (None).
120+ axes_class : subclass type of `~.axes.Axes`, optional
121+ The `.axes.Axes` subclass that is instantiated. If None, the base
122+ class of the host axes is used.
123+ kwargs
124+ Other parameters are forwarded to the parasite axes constructor.
113125 """
126+ if axes_class is None :
127+ axes_class = self ._base_axes_class
114128 parasite_axes_class = parasite_axes_class_factory (axes_class )
115- ax2 = parasite_axes_class (self , tr , viewlim_mode = viewlim_mode )
129+ ax2 = parasite_axes_class (
130+ self , tr , viewlim_mode = viewlim_mode , ** kwargs )
116131 # note that ax2.transData == tr + ax1.transData
117132 # Anything you draw in ax2 will match the ticks and grids of ax1.
118133 self .parasites .append (ax2 )
0 commit comments