+
    ,io.                         ^ RI t ^ RIt^ RIHtHtHt ^ RIHt	 ^ RI
HtHt ^ RIHt ^ RIHt  ! R R]4      tRt]P&                  P)                  ]R	7       R# )
    N)_api
_docstring
transforms)	_AxesBase_TransformedBoundsLocator)Axis)	Transformc                      a a ] tR t^t oRtRV 3R lltR tRR ltRV 3R llt]	P                  ! ]P                  4      RRR/R ll4       tR	 tV 3R
 ltR tR tR tR tRtVtV ;t# )SecondaryAxisz,
General class to hold a Secondary_X/Yaxis.
c                   < \         P                  ! RR.VR7       W@n        Wn        W n        RV n        V P                  P                  RR7      pV P                  R8X  d9   \        S	V `   ! V. RO3/ VB  V P                  V n
        RR.V n        RR	.V n        M7\        S	V `   ! V. RO3/ VB  V P                  V n
        R	R.V n        RR.V n        R
V n        V P                  W54       V P!                  V4       V P                  R8X  d   V P                  MV P                  pVP#                  \$        P&                  ! 4       4       VP)                  R4       V P*                  V P                  ,          P-                  R4       V P*                  V P                  ,          P-                  R4       V P.                  R8  d   V P                  R
R
R1,          V n        V P1                  V P                  ^ ,          4       R
# )z
See `.secondary_xaxis` and `.secondary_yaxis` for the doc string.
While there is no need for this to be private, it should really be
called by those higher level functions.
xy)orientationF)roottopbottomleftrightNnoneTg      ?)r         ?   -C6?)r   r   r   r   )r   check_in_list
_functions_parent_orientation
_ticks_set
get_figuresuper__init__xaxis_axis_locstrings_otherstringsyaxis_parentscaleset_locationset_functionsset_major_locatormtickerNullLocatorset_ticks_positionspinesset_visible_posset_alignment)
selfparentr   location	functions	transformkwargsfig	otheraxis	__class__s
   &&&&&&,  A/usr/lib/python3/dist-packages/matplotlib/axes/_secondary_axes.pyr!   SecondaryAxis.__init__   s    	C:;?#'ll%%5%1#GS"4??DJ %x0D"('!2DGS"4??DJ '0D"'!2D  	(.9% #'"3"3s":DJJ

	##G$7$7$9:$$V,D&&'33E:D$$%11$799s?#//"5D4++A./    c                   \         P                  ! V P                  VR7       WP                  ^,          8X  d   V P                  RRR1,          V n        V P                  V P                  ^ ,          ,          P	                  R4       V P                  V P                  ^,          ,          P	                  R4       V P
                  P                  V4       V P
                  P                  V4       R# )z
Set if axes spine and labels are drawn at top or bottom (or left/right)
of the Axes.

Parameters
----------
align : {'top', 'bottom', 'left', 'right'}
    Either 'top' or 'bottom' for orientation='x' or
    'left' or 'right' for orientation='y' axis.
)alignNTFr   )r   r   r$   r.   r/   r#   r-   set_label_position)r2   r?   s   &&r;   r1   SecondaryAxis.set_alignment<   s     	4++59$$Q''#//"5DD$$Q'(44T:D$$Q'(44U;

%%e,

%%e,r=   c                :   \         P                  ! \        P                  R3VR7       \	        V\
        4      '       d4   \         P                  ! V P                  VR7       VR9   d   RMRV n        M`\	        V\        P                  4      '       d   Wn        M9\        RV P                  ^ ,          : RV P                  ^,          : RV: 24      hWn        V P                  R	8X  dA   ^ V P                  RR
.pVe,   \        P                  ! V P                  P                   V4      pM>V P                  ^ R
^.pVe+   \        P                  ! W P                  P                   4      pVf   V P                  P                   pV P#                  \%        W24      4       R# )a  
Set the vertical or horizontal location of the axes in
parent-normalized coordinates.

Parameters
----------
location : {'top', 'bottom', 'left', 'right'} or float
    The position to put the secondary axis.  Strings can be 'top' or
    'bottom' for orientation='x' and 'right' or 'left' for
    orientation='y'. A float indicates the relative position on the
    parent Axes to put the new Axes, 0.0 being the bottom (or left)
    and 1.0 being the top (or right).

transform : `.Transform`, optional
    Transform for the location to use. Defaults to
    the parent's ``transAxes``, so locations are normally relative to
    the parent axes.

    .. versionadded:: 3.9
N)r6   )r4   r   g        zlocation must be z, z, or a float, not r   g|=)r   r   )r   check_isinstancer   r	   
isinstancestrr   r$   r0   numbersReal
ValueError_locr   blended_transform_factoryr   	transAxesset_axes_locatorr   )r2   r4   r6   boundss   &&& r;   r(   SecondaryAxis.set_locationO   sb   , 	z33T:iP h$$t//(C&*::DI',,// I#D$4$4Q$7#:"##A&));H<IJ J 	# B.F
 $&@@LL**I7	 iiE1-F$&@@||557	 ..I 	7JKr=   c                F   < V P                  4        \        SV `	  V4       R # N)	_set_limsr    apply_aspect)r2   positionr:   s   &&r;   rR   SecondaryAxis.apply_aspect   s    X&r=   minorFc               `    V P                   P                  ! W3R V/VB pRV n        RV n        V# )rU   T)r#   	set_ticksstaler   )r2   tickslabelsrU   r7   rets   &&&$, r;   rW   SecondaryAxis.set_ticks   s3    jj""5HHH

r=   c                v  a \        S\        4      '       dI   \        S4      ^8X  d9   \        S^ ,          4      '       d!   \        S^,          4      '       d	   SV n        MI\        S\
        4      '       d   SP                  V3R l3V n        MSf   R R 3V n        M\        R4      hV P                  4        R# )a  
Set how the secondary axis converts limits from the parent Axes.

Parameters
----------
functions : 2-tuple of func, or `Transform` with an inverse.
    Transform between the parent axis values and the secondary axis
    values.

    If supplied as a 2-tuple of functions, the first function is
    the forward transform function and the second is the inverse
    transform.

    If a transform is supplied, then the transform must have an
    inverse.
c                 B   < SP                  4       P                  V 4      # rP   )invertedr6   )r   r5   s   &r;   <lambda>-SecondaryAxis.set_functions.<locals>.<lambda>   s    9--/99!<r=   Nc                     V # rP    r   s   &r;   r`   ra      s    r=   c                     V # rP   rc   rd   s   &r;   r`   ra      s    ar=   zfunctions argument of secondary Axes must be a two-tuple of callable functions with the first function being the transform and the second being the inverse)	rD   tuplelencallabler   r	   r6   rH   
_set_scale)r2   r5   s   &fr;   r)   SecondaryAxis.set_functions   s    $ y%((S^q-@1&&8IaL+A+A (DO	9--$$<DO *K8DO @ A A 	r=   c                f   < V P                  4        V P                  4        \        SV `  V4       R# )z
Draw the secondary Axes.

Consults the parent Axes for its limits and converts them
using the converter specified by
`~.axes._secondary_axes.set_functions` (or *functions*
parameter when Axes initialized.)
N)rQ   ri   r    draw)r2   rendererr:   s   &&r;   rl   SecondaryAxis.draw   s%     	Xr=   c                B   V P                   R8X  d2   V P                  P                  P                  4       pV P                  pM0V P                  P
                  P                  4       pV P                  pWP                  8X  d   R# V P                  '       d   V P                  P                  4       pT! VR8X  d   RMRV P                  RRR1,          R7       V P                  '       d0   V P                  P                  \        P                  ! X4      4       Wn        R# )z#
Check if parent has set its scale
r   Nlogfunctionlogfunction)r5   r   )r   r   r"   	get_scale
set_xscaler&   
set_yscaler'   r   r#   get_ticklocsr   r*   r+   FixedLocator)r2   pscale	set_scalerY   s   &   r;   ri   SecondaryAxis._set_scale   s    
 #\\''113FI\\''113FI&&&???JJ++-E 	6U?-
 OODbD1	3
 ???JJ(()=)=e)DE #r=   c                   V P                   R8X  d(   V P                  P                  4       pV P                  pM&V P                  P	                  4       pV P
                  pV^ ,          V^,          8  pV P                  ^ ,          ! \        P                  ! V4      4      pV^ ,          V^,          8  pWC8w  d   VRRR1,          pV! V4       R# )zj
Set the limits based on parent limits and the convert method
between the parent and this secondary Axes.
r   Nr   )	r   r   get_xlimset_xlimget_ylimset_ylimr   nparray)r2   limsset_limorderneworders   &    r;   rQ   SecondaryAxis._set_lims   s    
 #<<((*DmmG<<((*DmmGQ$q'!q!"((4.17T!W$":Dr=   c                2    \         P                  ! R4       R# )zR
Secondary Axes cannot set the aspect ratio, so calling this just
sets a warning.
z)Secondary Axes can't set the aspect ratioN)r   warn_external)r2   argsr7   s   &*,r;   
set_aspectSecondaryAxis.set_aspect   s    
 	FGr=   c                "   V P                   V P                  ,          pVP                  VR7       V P                  P	                  4        F&  pVP
                  VJ g   K  VP                  V4       K(  	  VP                  P                  V4       R# )zl
Change the color of the secondary Axes and all decorators.

Parameters
----------
color : :mpltype:`color`
)colorsN)	_axis_mapr   set_tick_paramsr.   valuesaxis	set_colorlabel)r2   colorr   spines   &&  r;   r   SecondaryAxis.set_color  sl     ~~d//0E*[['')EzzT!& * 	

U#r=   )r#   r   rI   r$   r   r%   r   r'   r0   r   rX   rP   )__name__
__module____qualname____firstlineno____doc__r!   r1   r(   rR   r   copyr   rW   r)   rl   ri   rQ   r   r   __static_attributes____classdictcell____classcell__)r:   __classdict__s   @@r;   r   r      sn     )0V-&>L@'
 __T^^$U  %#J#:&H$ $r=   r   a  
Warnings
--------
This method is experimental as of 3.1, and the API may change.

Parameters
----------
location : {'top', 'bottom', 'left', 'right'} or float
    The position to put the secondary axis.  Strings can be 'top' or
    'bottom' for orientation='x' and 'right' or 'left' for
    orientation='y'. A float indicates the relative position on the
    parent Axes to put the new Axes, 0.0 being the bottom (or left)
    and 1.0 being the top (or right).

functions : 2-tuple of func, or Transform with an inverse

    If a 2-tuple of functions, the user specifies the transform
    function and its inverse.  i.e.
    ``functions=(lambda x: 2 / x, lambda x: 2 / x)`` would be an
    reciprocal transform with a factor of 2. Both functions must accept
    numpy arrays as input.

    The user can also directly supply a subclass of
    `.transforms.Transform` so long as it has an inverse.

    See :doc:`/gallery/subplots_axes_and_figures/secondary_axis`
    for examples of making these conversions.

transform : `.Transform`, optional
    If specified, *location* will be
    placed relative to this transform (in the direction of the axis)
    rather than the parent's axis. i.e. a secondary x-axis will
    use the provided y transform and the x transform of the parent.

    .. versionadded:: 3.9

Returns
-------
ax : axes._secondary_axes.SecondaryAxis

Other Parameters
----------------
**kwargs : `~matplotlib.axes.Axes` properties.
    Other miscellaneous Axes parameters.
)_secax_docstring)rF   numpyr   
matplotlibr   r   r   matplotlib.tickertickerr+   matplotlib.axes._baser   r   matplotlib.axisr   matplotlib.transformsr	   r   r   interpdregisterrc   r=   r;   <module>r      sO      3 3 # F   +F$I F$R, Z     -=  >r=   