+
     ]i!  c                   s2   R t ^ RIHt ^ RIHt ^ RIHt  ! R R4      t ! R R]4      t ! R R	]4      t	 ! R
 R]4      t
]
tR t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tRR lt ! R R]4      tR# )aY  
Provides classes of simple units that will be used with `.AxesDivider`
class (or others) to determine the size of each Axes. The unit
classes define `get_size` method that returns a tuple of two floats,
meaning relative and absolute sizes, respectively.

Note that this class is nothing more than a simple tuple of two
floats. Take a look at the Divider class to see how these two
values are used.

Once created, the unit classes can be modified by simple arithmetic
operations: addition /subtraction with another unit type or a real number and scaling
(multiplication or division) by a real number.
)Real)_api)Axesc                   sP   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )_Basec                s    W,          # N selfZother   &&H/usr/lib64/python3.14/site-packages/mpl_toolkits/axes_grid1/axes_size.py__rmul__Z_Base.__rmul__   s
    |    c                sP    \        V\        4      '       g   \        # \        W4      # r   )
isinstancer    ZNotImplementedFractionr   r   r	   __mul__Z_Base.__mul__   s     %&&!!$$r   c                s"    ^V,          V ,          # )   r   r   r   r	   __div__Z_Base.__div__   s    E	T!!r   c                sn    \        V\        4      '       d   \        W4      # \        V \        V4      4      # r   )r   r   AddFixedr   r   r	   __add__Z_Base.__add__"   s+    eU##t##tU5\**r   c                s    RV ,          # )r   r   )r   s   &r	   __neg__Z_Base.__neg__(   s    Dyr   c                s,    \        V \        V4      4      # r   )r   r   r   r   r	   __radd__Z_Base.__radd__+   s     4u&&r   c                s    W) ,           # r   r   r   r   r	   __sub__Z_Base.__sub__0   s    vr   c                s    \        R4      h)z:
Return two-float tuple with relative and absolute sizes.
zSubclasses must implement)ZNotImplementedError)r   rendererr   r	   get_sizeZ_Base.get_size3   s     ""=>>r   r   N)__name__
__module____qualname____firstlineno__r
   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__   @r	   r   r      s2     %
"+'
? ?r   r   c                   s0   a  ] tR t^:t o RtR tR tRtV tR# )r   z
Sum of two sizes.
c                s    Wn         W n        R # r   _a_b)r   aZb   &&&r	   __init__ZAdd.__init__?   s    r   c                s    V P                   P                  V4      w  r#V P                  P                  V4      w  rEW$,           W5,           3# r   )r$   r   r%   )r   r   Z
a_rel_sizeZ
a_abs_sizeZ
b_rel_sizeZ
b_abs_size   &&    r	   r   ZAdd.get_sizeC   sA    !%!1!1(!;
!%!1!1(!;
&
(???r   r#   N	r   r   r   r   __doc__r(   r   r   r   r    r"   r	   r   r   :   s     @ @r   r   c                   s0   a  ] tR t^It o RtR tR tRtV tR# )r   zL
Simple fixed size with absolute part = *fixed_size* and relative part = 0.
c                sJ    \         P                  ! \        VR 7       Wn        R# )
fixed_sizeN)r   check_isinstancer    r-   )r   r-   r   r	   r(   ZFixed.__init__N   s    dz:$r   c                s$    R pV P                   pW#3#         r,   r   r   rel_sizeabs_size   &&  r	   r   ZFixed.get_sizeR   s    ??!!r   r,   Nr*   r    r"   r	   r   r   I   s     %" "r   r   c                   s0   a  ] tR t^Xt o RtR tR tRtV tR# )ScaledzS
Simple scaled(?) size with absolute part = 0 and
relative part = *scalable_size*.
c                s    Wn         R # r   Z_scalable_size)r   Zscalable_sizer   r	   r(   ZScaled.__init__^   s    +r   c                s$    V P                   pR pW#3# r/   r6   r1   r4   r	   r   ZScaled.get_sizea   s    &&!!r   r6   Nr*   r    r"   r	   r5   r5   X   s     
," "r   r5   c                 s8    V P                  4       pVR 8X  d   RpV# )Zauto      ?)Z
get_aspect)axaspects   & r	   _get_axes_aspectr:   i   s    ]]_FMr   c                   s4   a  ] tR t^pt o RtRR ltR tRtV tR# )AxesXzi
Scaled size whose relative part corresponds to the data width
of the *axes* multiplied by the *aspect*.
Nc                V    Wn         W n        VR 8X  d   Vf   \        R4      hW0n        R# axesNz%ref_ax must be set when aspect='axes'_axes_aspect
ValueError_ref_axr   r>   r9   Zref_ax   &&&&r	   r(   ZAxesX.__init__v   )    
VDEEr   c                s   V P                   P                  4       w  r#V P                  R 8X  d3   \        V P                  4      pV\        V P                   4      ,          pMV P                  p\        W2,
          4      V,          pRpWg3# r>   r0   )r@   Zget_xlimrA   r:   rC   absr   r   Zl1Zl2Z
ref_aspectr9   r2   r3      &&      r	   r   ZAxesX.get_size}   sk    $$&<<6!)$,,7J"24::">>F\\Fru:f$!!r   rA   r@   rC   r7   Nr*   r    r"   r	   r;   r;   p   s     

" 
"r   r;   c                   s4   a  ] tR t^t o RtRR ltR tRtV tR# )AxesYzj
Scaled size whose relative part corresponds to the data height
of the *axes* multiplied by the *aspect*.
Nc                r<   r=   r?   rD   rE   r	   r(   ZAxesY.__init__   rF   r   c                s   V P                   P                  4       w  r#V P                  R 8X  d,   \        V P                  4      p\        V P                   4      pMV P                  p\        W2,
          4      V,          pRpWg3# rG   )r@   Zget_ylimrA   r:   rC   rH   rI   rJ   r	   r   ZAxesY.get_size   se    $$&<<6!)$,,7J%djj1F\\Fru:f$!!r   rK   rL   r*   r    r"   r	   rM   rM      s     
" "r   rM   c                   s6   a  ] tR t^t o RtR tR tR tRtV t	R# )	MaxExtentzh
Size whose absolute part is either the largest width or the largest height
of the given *artist_list*.
c                sR    Wn         \        P                  ! R R.VR7       W n        R# )widthheight)w_or_hN)_artist_listr   check_in_list_w_or_h)r   artist_listrQ   r'   r	   r(   ZMaxExtent.__init__   s"    'GX.v>r   c                s<    V P                   P                  V4       R # r   )rR   Zappend)r   r&   r   r	   
add_artistZMaxExtent.add_artist   s      #r   c                s    R pV P                    Uu. uFC  p\        VP                  V4      V P                  4      VP                  P
                  ,          NKE  	  pp\        V^ R7      pW%3# u upi )r0   )Zdefault)rR   ZgetattrZget_window_extentrT   Zfiguredpimax)r   r   r2   r&   Zextent_listr3   r)   r	   r   ZMaxExtent.get_size   sq     &&(& A''14<<@188<<OO& 	 ( {A.!!	(s   A	A,)rR   rT   N)
r   r   r   r   r+   r(   rV   r   r   r   r    r"   r	   rN   rN      s     

$" "r   rN   c                   s6   a a ] tR t^t oRtV 3R ltRtVtV ;t# )MaxWidthzK
Size whose absolute part is the largest width of the given *artist_list*.
c                (   < \         SV `  VR 4       R# )rO   NZsuperr(   r   rU   	__class__   &&r	   r(   ZMaxWidth.__init__   s    g.r   r   	r   r   r   r   r+   r(   r   r   Z__classcell__r]   r!      @@r	   rY   rY      s     / /r   rY   c                   s6   a a ] tR t^t oRtV 3R ltRtVtV ;t# )	MaxHeightzL
Size whose absolute part is the largest height of the given *artist_list*.
c                rZ   )rP   Nr[   r\   r^   r	   r(   ZMaxHeight.__init__   s    h/r   r   r_   r`   ra   r	   rb   rb      s     0 0r   rb   c                   s0   a  ] tR t^t o RtR tR tRtV tR# )r   z]
An instance whose size is a *fraction* of the *ref_size*.

>>> s = Fraction(0.3, AxesX(ax))
c                sV    \         P                  ! \        VR 7       W n        Wn        R# ))fractionN)r   r.   r    _fraction_ref	_fraction)r   rc   Zref_sizer'   r	   r(   ZFraction.__init__   s    dX6%!r   c                s    V P                   f   V P                  R3# V P                   P                  V4      w  r#W P                  ,          pW0P                  ,          pWE3# )Nr0   )rd   re   r   )r   r   Zrr&   r2   r3   r)   r	   r   ZFraction.get_size   sV    %>>2%%%%..x8DA'H'H%%r   )re   rd   Nr*   r    r"   r	   r   r      s     "
& &r   r   Nc                s    \        V \        4      '       d   \        V 4      # \        V \        4      '       d.   V R,          R8X  d    \	        \        V RR 4      ^d,          V4      # \        R4      h)aG  
Create a Fixed unit when the first argument is a float, or a
Fraction unit if that is a string that ends with %. The second
argument is only meaningful when Fraction unit is created.

>>> from mpl_toolkits.axes_grid1.axes_size import from_any
>>> a = from_any(1.2) # => Fixed(1.2)
>>> from_any("50%", a) # => Fraction(0.5, a)
Z%NzUnknown formatr   )r   r    r   Zstrr   ZfloatrB   )ZsizeZfraction_refr   r	   from_anyrf      s\     $T{	D#		8s?E$s),s2LAA
%
&&r   c                   sL   a  ] tR t^t o RtRR RR RR RR	 /tR
 tR tRtV t	R# )_AxesDecorationsSizezL
Fixed size, corresponding to the size of decorations on a given Axes side.
Zleftc                <    VP                   V P                   ,
          # r   )ZxminZtight_bbZaxes_bbr   r	   <lambda>_AxesDecorationsSize.<lambda>       GLL8==,Hr   Zrightc                <    V P                   VP                   ,
          # r   )Zxmaxri   r   r	   rj   rk          HMMGLL,Hr   Zbottomc                rh   r   )Zyminri   r   r	   rj   rk      rl   r   Ztopc                rm   r   )Zymaxri   r   r	   rj   rk      rn   r   c                s    \         P                  ! V P                  VR 7       W n        \	        V\
        4      '       d   V.V n        R# TV n        R# ))	directionN)r   rS   _get_size_map
_directionr   r   _ax_list)r   r8   ro   r'   r	   r(   Z_AxesDecorationsSize.__init__  s8    4--C# *2t 4 4"r   c                s   \        V P                   Uu. uFB  pV P                  V P                  ,          ! VP	                  VR R7      VP
                  4      NKD  	  up4      pVP                  ^H4      pW4,          p^ pWe3# u upi )F)Zcall_axes_locator)rX   rr   rp   rq   Zget_tightbboxZbboxZpoints_to_pixels)r   r   r8   ZszrW   r3   r2   s   &&     r	   r   Z_AxesDecorationsSize.get_size  s     mm% $ t/  U CRWWN#% & ''+8!!%s   AB)rr   rq   N)
r   r   r   r   r+   rp   r(   r   r   r   r    r"   r	   rg   rg      s:     
 	HHHH	M=
" "r   rg   r   )r+   Znumbersr    Z
matplotlibr   Zmatplotlib.axesr   r   r   r   r5   ZScalabler:   r;   rM   rN   rY   rb   r   rf   rg   r   r   r	   <module>rs      s       !? !?H@% @"E ""U " "E "4"E "6" "./y /0	 0&u &,'$"5 "r   