
    A>iF                    &   S SK Jr  S SKJrJrJr  S SKrS SKrS SK	r
S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S SKrS SKJs  Jr  S S
KJr  S SKJ r   S SK!J"r"J#r#  S SK$J%r%  S SK&J'r'  S SK(J)r)J*r*J+r+  \(       a  S SK,J-r-  S SK.J/r/  S SK0J1r1  S SK2J3r3  S SK4J5r5  SS jr6 " S S\"5      r7SS jr8        S     S S jjr9         S!       S"S jjr:         S!       S"S jjr;          S#             S$S jjr<g)%    )annotations)TYPE_CHECKINGLiteral
NamedTupleN)lib)cache_readonly)find_stack_level)is_dict_like)	ABCSeries)remove_na_arraylike)Version)pprint_thing)LinePlotMPLPlot)create_iter_data_given_by)get_standard_colors)create_subplotsflatten_axesmaybe_adjust_figure)
Collection)Axes)Figure)Line2D)MatplotlibColorc                   U(       a  U R                  5       OU R                  5       n[        U5      [        U5      :w  aW  [        [        U5      [        U5      5      u  pV[	        [
        R                  5      [	        S5      :  a  US:X  d   U5       eX-  nU(       a  U R                  " U40 UD6  gU R                  " U40 UD6  g)zSet the tick labels of a given axis.

Due to https://github.com/matplotlib/matplotlib/pull/17266, we need to handle the
case of repeated ticks (due to `FixedLocator`) and thus we duplicate the number of
labels.
z3.10r   N)	
get_xticks
get_ytickslendivmodr   mpl__version__set_xticklabelsset_yticklabels)axlabelsis_verticalkwargsticksi	remainders          b/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/plotting/_matplotlib/boxplot.py_set_ticklabelsr,   0   s      +BMMOE
5zS[ c%j#f+63??#gfo5>,9,>
6,V,
6,V,    c                  @  ^  \ rS rSr\SS j5       rSrSr " S S\5      r	SSS jjr
\ S     SS jj5       rS	 r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       r  S   SS jjrSS jrSS jrSS jrS S jr\S!S j5       r\U 4S j5       rSrU =r$ )"BoxPlotC   c                    g)Nbox selfs    r+   _kindBoxPlot._kindD   s    r-   
horizontal)Naxesdictbothc                  *    \ rS rSr% S\S'   S\S'   Srg)
BoxPlot.BPL   r   r$   zdict[str, list[Line2D]]linesr3   N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r3   r-   r+   BPr=   L   s    &&r-   rF   c                    X R                   ;  a  [        S5      eX l        [        R                  " X40 UD6  U R
                  (       a   U R                  S:X  a  SU l        g SU l        g g )Nz2return_type must be {None, 'axes', 'dict', 'both'}verticalF)	_valid_return_types
ValueErrorreturn_typer   __init__subplotsorientationsharexsharey)r5   datarK   r'   s       r+   rL   BoxPlot.__init__Q   s]    666QRR&.v.== :-## r-   c                |   UR                   S:X  ab  U Vs/ s H  n[        U5      PM     nnU Vs/ s H9  ofR                  S:  a  UO$[        R                  " [        R
                  /5      PM;     nnO[        U5      nUR                  " U40 UD6nUS:X  a  X4$ US:X  a  U R                  XS9U4$ X4$ s  snf s  snf )N   r   r:   r;   r$   r?   )ndimr   sizenparraynanboxplotrF   )	clsr$   y
column_numrK   kwdsvysbps	            r+   _plotBoxPlot._plotb   s    
 66Q;234!Q%a(!B4 DFF2avvz!rxx'992BFB$Q'BZZ#d#& 6MF"66R6*B..6M 5 Gs   B4A B9c                    U[         R                  L a  g Ub  [        R                  " S[	        5       S9  [        U[        5      (       a#  / SQnU H  nXC;  d  M
  [        SU SU 35      e   U$ )NzC'color' and 'colormap' cannot be used simultaneously. Using 'color')
stacklevelboxeswhiskersmedianscaps!color dict contains invalid key ''. The key must be either )r   
no_defaultwarningswarnr	   
isinstancer:   rJ   )r5   colorcolormap
valid_keyskeys        r+   _validate_color_argsBoxPlot._validate_color_argsx   s{    CNN"MMU+-
 eT""AJ($;C5 A22<?   r-   c                ,    [        SU R                  S S9$ )N   )
num_colorsrs   rr   )r   rs   r4   s    r+   _color_attrsBoxPlot._color_attrs   s     #a$--tTTr-   c                     U R                   S   $ Nr   r{   r4   s    r+   _boxes_cBoxPlot._boxes_c         ##r-   c                     U R                   S   $ r~   r   r4   s    r+   _whiskers_cBoxPlot._whiskers_c   r   r-   c                     U R                   S   $ )NrT   r   r4   s    r+   
_medians_cBoxPlot._medians_c   r   r-   c                     U R                   S   $ r~   r   r4   s    r+   _caps_cBoxPlot._caps_c   r   r-   c                    g Nr3   )r5   rz   
color_kwdss      r+   _get_colorsBoxPlot._get_colors   s     	r-   c                   [        U R                  [        5      (       a  U R                  R                  SU R                  5      nU R                  R                  SU R
                  5      nU R                  R                  SU R                  5      nU R                  R                  SU R                  5      nO|U R                  =(       d    U R                  nU R                  =(       d    U R
                  nU R                  =(       d    U R                  nU R                  =(       d    U R                  nX#XE4n[        U4SU0U R                  D6  g )Nrh   ri   rj   rk   	color_tup)
rq   rr   r:   getr   r   r   r   maybe_color_bpr_   )r5   rb   rh   ri   rj   rk   r   s          r+   r   BoxPlot.maybe_color_bp   s    djj$''JJNN7DMM:Ezz~~j$2B2BCHjjnnY@G::>>&$,,7D JJ/$--Ezz5T%5%5Hjj3DOOG::-Dg4	r<Y<$))<r-   c                   U R                   (       Ga  / n/ nU R                  b   [        U R                  U R                  5      OU R                  n[        U R                  US95       GH  u  nu  pgU R                  U5      nU R                  R                  5       n	U R                  be  UR                  nUR                  [        U5      5        U R                  R                  R                  n
U
S    Vs/ s H  n[        U5      PM     nnO[        U5      /nU R                  " X4XPR                   S.U	D6u  pU R#                  U5        UR%                  U5        UR%                  U5        ['        XU R(                  S:H  S9  GM      [*        R,                  " X#[.        S9U l        g U R                  R2                  R                  nU R                  S5      nU R                  R                  5       n	U R                  " X4SU R                   S.U	D6u  pU R#                  U5        Xl        U R                  R                   Vs/ s H  n[        U5      PM     nnU R4                  (       d-  [7        [9        U5      5       Vs/ s H  n[        U5      PM     nn['        UUU R(                  S:H  S9  g s  snf s  snf s  snf )N)rQ   r   )r^   rK   rH   )r$   r%   r&   )indexdtype)rM   byr   rQ   r6   	enumerate
_iter_data_get_axr_   copyT	set_titler   columnslevelsrc   rK   r   appendr,   rN   pdSeriesobject_return_objvalues	use_indexranger   )r5   figobj_axes
obj_labelsrQ   r)   labelr]   r$   r_   r   col
ticklabelsretrb   leftr%   ru   s                     r+   
_make_plotBoxPlot._make_plot   sV   ===HJ
 77& *$))TZZ@YY  "+4???+E!F:E\\!_yy~~' 77&ALLe!45
 "YY..55F?Eay!Iy,s"3yJ!IJ".u"5!6J**&'5E5EIM ##B'$!!%($:J:Jj:X1 "G6  "yy6RD		  ""AaB99>>#Djj"#1A1AEIGC #"59YY5F5FG5FTl4(5FFG>>7<S[7IJ7I,s+7IJf$2B2Bj2P9 "J2 HJs   6J3J8J=c                    g r   r3   r4   s    r+   _make_legendBoxPlot._make_legend   s    r-   c                    U R                   (       a$  UR                  [        U R                   5      5        U R                  (       a%  UR	                  [        U R                  5      5        g g r   )xlabel
set_xlabelr   ylabel
set_ylabel)r5   r$   rQ   s      r+   _post_plot_logicBoxPlot._post_plot_logic   s?    ;;MM,t{{34;;MM,t{{34 r-   c                H    U R                   R                  SS5      (       a  gg)NvertTrH   r8   )r_   r   r4   s    r+   rN   BoxPlot.orientation  s    99==&&r-   c                J   > U R                   c
  [        TU ]  $ U R                  $ r   )rK   superresultr   )r5   	__class__s    r+   r   BoxPlot.result
  s%    #7>!###r-   )r   rK   rO   rP   )returnzLiteral['box'])r9   )rK   strr   None)Nr9   )r$   r   r]   z
np.ndarrayrK   r   )Nrr   )r   zQdict[str, MatplotlibColor] | MatplotlibColor | Collection[MatplotlibColor] | Noner   r   r   r   )r   r   r   r   )r$   r   r   r   )r   z!Literal['horizontal', 'vertical'])r@   rA   rB   rC   propertyr6   _layout_typerI   r   rF   rL   classmethodrc   rv   r   r{   r   r   r   r   r   r   r   r   r   rN   r   rE   __classcell__)r   s   @r+   r/   r/   C   s-      L8'Z '
$" JP$DG *( U U $ $ $ $ $ $ $ $
   
="8t5     $ $r-   r/   c                   UR                  S5      (       d%  [        R                  R                  U S   US   SS9  UR                  S5      (       d%  [        R                  R                  U S   US   SS9  UR                  S5      (       d%  [        R                  R                  U S	   US
   SS9  UR                  S5      (       d&  [        R                  R                  U S   US   SS9  g g )Nboxpropsrh   r      )rr   alphawhiskerpropsri   medianpropsrj   rT   cappropsrk   ry   )r   r    artistsetp)rb   r   r_   s      r+   r   r     s     88J

79Q<qA88N##

:il!D88M""

9Yq\C88J

6
)A,a@  r-   c
           	     b   UR                  USS9nUcG  [        U[        [        45      (       d  U/nUR	                  5       R
                  R                  U5      n[        U5      n[        UU
R                  SS5      U
R                  SS5      UUUS9u  pU
R                  SS 5      U
R                  SS 5      nnU
R                  S	S5      (       a  U=(       d    UnOU=(       d    Un/ n[        [        U5      USS
9 HZ  u  nnUU   n[        USS06u  nnU " UUU4UUS.U
D6nUR                  U5        UR                  U5        UR                  U5        M\     [         R"                  " UUSS9nU	c  Un[        U5      S:X  a  US   OUnUR%                  SU 35        ['        USSSSSS9  U$ )NF)observedrO   TrP   )naxesrO   rP   figsizer$   layoutr   r   r   strictr   )r   r   )r   r   r   r   zBoxplot grouped by 333333??皙?皙?bottomtopr   rightwspace)groupbyrq   listtuple_get_numeric_datar   
differencer   r   popr   zipr   r   r   gridr   r   suptitler   )plotfrQ   r   r   numeric_onlyr   r   r$   r   rK   r'   groupedr   r   r9   r   r   	ax_valuesr   gp_colkeysr   re_plotfr   bylines                            r+   _grouped_plot_by_columnr     s    ll2l.G"tUm,,B((*22==bALEzz(D)zz(D)IC ZZ$/Hd1KFFzz&$22I|D)75ACF040fvrR&R6R
S"
 B YYye<F "glRUFLL&vh/0Dc3sSMr-   c
                  ^^^	^
^ SS K Jn  T	[        R                  ;  a  [	        S5      e[        U [        5      (       a  U R                  S5      n SnU
4S jnSUUU	U4S jjnU" 5       mUc  S nO![        U[        [        45      (       a  UnOU/nUb  [        UU 4UUUUUUT	S.T
D6nU$ T	c  Sm	Ub  [	        S5      eUc8  Ub  S	U0O0 n[        R                  " U5         UR                  5       nS S S 5        U R                  5       n [        U R                   5      nUS:X  a  [	        S
5      eUc  U R                   nOX   n U" XR"                  R$                  U40 T
D6nUR'                  U5        U$ ! , (       d  f       N= f)Nr   z,return_type must be {'axes', 'dict', 'both'}xc                   > [        SS9n [        R                  " U / SQ5      n[        R                  " US5      nTR	                  SS 5      nU(       ay  [        U5      (       aX  / SQn[        [        U[        S5      SS	95      nUR                  5        H!  u  pVXS;   a  XaXE   '   M  [        S
U SU 35      e   U$ UR                  U5        U$ )Nry   )rz   )r   r   rT   krr   rg      Tr   rl   rm   )r   rX   taker   r   r
   r:   r   r   itemsrJ   fill)result_listr   colorsrt   key_to_indexru   valuer_   s          r+   r   boxplot.<locals>._get_colorsp  s     *Q7i063''4(F## F
#C
E!HT$JK"(,,.JC(49|01(?u E66@\C 	 #1  F#r-   c                2  > UR                  SS 5      UR                  SS 5      pTU(       a  UR                  [        U5      5        U(       a  UR                  [        U5      5        U  Vs/ s H  n[        U5      PM     n nU Vs/ s H  n[	        U5      PM     nnUR
                  " U40 UD6nT
b  UR                  ST
S9  [        X UR                  SS5      TS9  [        U4ST	0UD6  TS	:X  a  U$ TS:X  a  [        R                  X(S
9$ U$ s  snf s  snf )Nr   r   r;   )axis	labelsizer   T)r$   r%   r&   rotationr   r:   rU   )r   r   r   r   r   r[   tick_paramsr,   r   r   r/   rF   )r   r   r$   r_   r   r   r   r`   rb   r  fontsizerK   rots            r+   
plot_groupboxplot.<locals>.plot_group  s   (D1488Hd3KMM,v./MM,v./)-.AQ.289&Q%a(&9ZZ'$'NN(N; 	DHHVT,BS	
 	r4V4t4 & IF":::..I% /9s   +DD)r   r   r   r   r$   r   rK   r9   z7The 'layout' keyword is not supported when 'by' is Nonezfigure.figsizez;boxplot method requires numerical columns, nothing to plot.)r$   r   )matplotlib.pyplotpyplotr/   rI   rJ   rq   r   to_framer   r   r   r    
rc_contextgcar   r   r   r   r   r   )rQ   columnr   r$   r  r  r   r   r   rK   r_   pltr   r  r   r   rcr   r  s       ``   ``       @r+   r[   r[   Y  s    $ '555GHH$	""}}S!: 8 ]F~	FT5M	*	*(	~ )
 #
 
H M/  KVWW:070C"G,B#WWY $%%'DLL!A:M  ?llG=DG[[]]B?$?
M! $#s   !E55
Fc
                ^    SS K Jn  [        U 4UUUUUUUUU	S.	U
D6nUR                  5         U$ )Nr   )	r  r   r$   r  r   r  r   r   rK   )r  r  r[   draw_if_interactive)r5   r  r   r$   r  r  r   r   r   rK   r_   r  s               r+   boxplot_framer    sQ     $	

 
B Ir-   c                ^   USL a  [        U 5      n[        USUU	U
UUS9u  p0 n[        U [        U5      SS9 H>  u  u  nnnUR                  " SXbX4US.UD6nUR                  [        U5      5        UUU'   M@     [        R                  " U5      n[        USSSSS	S
9  U$ [        U SS06u  nn[        R                  " UUSS9nUbL  [        R                  " U5      n[        R                  R                  UU/5      n[        UR                   5      nUR                  " SUUUUUUUS.UD6nU$ )NTF)r   squeezer$   rO   rP   r   r   r   )r$   r  r  r  r   r   r   r   r   r   r   r   )r   r  )r  r  r  r   r$   r   r   r3   )r   r   r   r   r[   r   r   r   r   r   concatcomconvert_to_list_like
MultiIndexfrom_productr   r   )r   rM   r  r  r  r   r$   r   r   rO   rP   r_   r   r   r9   rQ   ru   groupdr   r   framesdf	multi_keys                           r+   boxplot_frame_groupbyr&    sf    4G#
	  #G\$-? NLS%" xtOSA LLc*+DI !O iioC#CsSVW. J+ G1D1fYYvDq1 --f5F22D&>BI)**+Fjj 	
	
 	
 Jr-   )r$   r   r%   z	list[str]r&   boolr   r   r   )NNTFNNNN)r   r'  r   r'  r   tuple[float, float] | None)	NNNNr   TNNN)r  
int | Noner  intr   r'  r   r(  )
TNNr   TNNNFT)rM   r'  r  r)  r  r*  r   r'  r   r(  rO   r'  rP   r'  )=
__future__r   typingr   r   r   ro   
matplotlibr    numpyrX   pandas._libsr   pandas.util._decoratorsr   pandas.util._exceptionsr	   pandas.core.dtypes.commonr
   pandas.core.dtypes.genericr   pandas.core.dtypes.missingr   pandasr   pandas.core.commoncorecommonr  pandas.util.versionr   pandas.io.formats.printingr    pandas.plotting._matplotlib.corer   r   #pandas.plotting._matplotlib.groupbyr   !pandas.plotting._matplotlib.styler   !pandas.plotting._matplotlib.toolsr   r   r   collections.abcr   matplotlib.axesr   matplotlib.figurer   matplotlib.linesr   pandas._typingr   r,   r/   r   r   r[   r  r&  r3   r-   r+   <module>rD     s   " 
     2 4 2 0 :      ' 3 J A  *$('.-&L$h L$^
A  *.7
 7 7 (7x *.
  
  (H *.
  
  (D *.88 	8
 
8 8 (8 8 8r-   