
    hMh             #       	   d dl mZ d dlmZ d dlZd dlmZ d dlmZ d dl	Z
d dlZd dlZd dlmZ d dlmZ d dlmZ d d	lmZ d dlmZ d d
lmZmZ d dlmZmZm Z  d dl!m"Z" d dl#m$Z$ d dl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- d dl.m/Z/ d dl0m1Z1m2Z2m3Z3 d dl4m5Z5 d dl6m7Z7m8Z8 g dZ9 G d de          Z: G d de:          Z; e<di d ed          d ed          d ed          d ed          d  ed!          d" ed#          d$ ed%          d& ed'          d( ed)          d* ed+          d, ed-          d. ed/          d0 ed1          d2 ed3          d4 ed5          d6 ed7          d8 ed9          d: ed;          d< ed=          d> ed?          d@ edA          dB edC          dD edE          dF edG          dH edI          dJ edK          dL edM          dN edO          dP edQ          dR edS          dT edU          dV edW          dX edY          dZ ed[          d\ ed]          d^ ed_          Z=e=>                    e8           	 dddddddddd`dadbdcd dddbddddedddbddfdgZ?  edh          j@        di e=e?_A        	 dddddddddd`dadidedcdbd ddbdjdkdldmdndeddddedbeeedddo!dpZB  edq          j@        di e=eB_A        	 dddddddddd`dadbdcd dddrdsdtdudadddeddbedddddvdwZC  edx          j@        di e=eC_A        	 dddddddadeddddyed dddeddbddzd{ZD  ed|          j@        di e=eD_A        	 dddddddeddddydd dddeddbdudd}d~ZE  ed          j@        di e=eE_A        	 dddddddddddddddd`daddcdbd ddeddbd deeedddZF  ed          j@        di e=eF_A        	 dddddddddddddddeededdedd ddbdeeeedddZG  ed          j@        di e=eG_A        	 dddddddddd`dadddcdbd ddeddbdddZH  ed          j@        di e=eH_A        	 dddddddddddddddddddydmddeddddddbdadadadeded!dZI  ed          j@        di e=eI_A         G d d          ZJ edd          ZK G d d          ZLdS )    )
namedtuple)dedentN
rgb_to_hls)partial)normalize_kwargs)PatchCollection)MarkerStyle)	Rectangle)default
deprecated)VectorPlotterinfer_orientcategorical_order)KDE)utils)
desaturate_check_argument_draw_figure_default_color_get_patch_legend_artist_get_transform_functions_scatter_legend_artist_version_predates)groupby_apply_include_groups)EstimateAggregatorLetterValuesWeightedAggregator)light_palette)	FacetGrid_facet_docs)	catplot	stripplot	swarmplotboxplot
violinplot	boxenplot	pointplotbarplot	countplotc                        e Zd ZddddZddiZdgZdi dddddf fd		Zd#d
Zd Zd Z	d Z
d Zd Zd Zd Zd Zd Zd Zd Zd$dZd%dZed             Zd Zd Z fdZd Zd Zd Zd  Zd! Zd" Z xZ S )&_CategoricalPlotterz@columns@valuesxyhuer0   colorNFautoc                 2   t                                          ||           | j        dk    r|dv r| j                            ddd          | _        t          | j                  }| j                            dd           }	| j                            dd           }
| j                            dd           }| j                            dd           }d|v r|	| j        d<   || j        d<   d|v r|
| j        d<   || j        d<   | j        dk    rAd| j        v r8|6| j        	                    dd	
           | j                            d           t          | j                            dd           | j                            dd           |d          | _        || _        | j        sd S | j        | j        vr-d | j        | j        <   d| j        | j        <   d| j        | j        <   t          | j        | j                 |          }|| j        | j        <   d S )N)data	variableswide)hr0   r0   r/   r/   r0   columnsr1      axisF)r/   r0   orientrequire_numericcategorical )super__init__input_format	plot_datarenamesetr6   pop	var_typesdropr   getr?   legendhas_xy_datar   
var_levels)selfr5   r6   orderr?   r@   r2   rM   orig_variablesorig_xorig_yorig_x_typeorig_y_type
cat_levels	__class__s                 S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/seaborn/categorical.pyrD   z_CategoricalPlotter.__init__8   s/    	di888 &&6Z+?+?!^223;O;O2PPDN 00N^''T22F^''T22F.,,S$77K.,,S$77Kn$$&,s#&1s#n$$&,s#&1s# ''''!NA...Nu%%% #n  d++n  d++!	
 
 
   	F
 ;dn,,*.DN4;'*7DN4;'*,DN4;' 't~dk'BEJJ
'1$$$    c                    |du p|du}|rd| j         vr|rd| _        | j        | j                 | j        d<   | j         | j                 | j         d<   d| j        d<   | j        | j                 }t          |t                    rd |                                D             }nFd| j         v r4| j        d         | j        | j                 k    	                                }nd}|| _        d| j         v r_|]|[t          |t                    st          j                            |          }d| }d| d	}t          j        |t           d
           ||fS )a  Implement backwards compatibility for hue parametrization.

        Note: the force_hue parameter is used so that functions can be shown to
        pass existing tests during refactoring and then tested for new behavior.
        It can be removed after completion of the work.

        Nr1   TrA   c                 4    i | ]\  }}t          |          |S  )str.0kvs      rY   
<dictcomp>z7_CategoricalPlotter._hue_backcompat.<locals>.<dictcomp>   s$    AAAA3q661AAArZ   Fzdark:zf

Setting a gradient palette using color= is deprecated and will be removed in v0.14.0. Set `palette='z'` for the same effect.
   
stacklevel)r6   _redundant_huerF   r?   rJ   rO   
isinstancedictitemsallr^   mplcolorsto_hexwarningswarnFutureWarning)rP   r2   palette	hue_order	force_huedefault_behavior	redundantmsgs           rY   _hue_backcompatz#_CategoricalPlotter._hue_backcompat   s   $ !D=?G4,? 	,dn449I4"&D$(N4;$?DN5!$(N4;$?DN5!$1DN5!4I '4(( BAAAAA &&!^E2dnT[6QQVVXX		!	"+D
 DN""w5;LeS)) 1
))%00%eooGX5<X X X  M#};;;;	!!rZ   c                    d| j         vr|d| j         d}t          j        |t          d           d| _        | j        | j                 | j        d<   | j                             | j                  | j         d<   | j                            | j                  | j        d<   | j	                            | j                  }| j
                            dd           |S )z?Provide one cycle where palette= implies hue= when not providedr1   Nzf

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `z@` variable to `hue` and set `legend=False` for the same effect.
rd   re   F)r6   r?   ro   rp   rq   rM   rF   rL   rJ   rO   _var_levelsrI   )rP   rr   rs   rw   s       rY   _palette_without_hue_backcompatz3_CategoricalPlotter._palette_without_hue_backcompat   s    &&7+>I?C{I I I 
 M#};;;;DK$(N4;$?DN5!$(N$6$6t{$C$CDN5!$(N$6$6t{$C$CDN5!++DK88I  ---rZ   c                 F   |t           urRt          j        d         dz  |z  }|dz  }|dz  }d}t          j        |d           |                    |||           |t           ur<d	}|s|d
z  }|                    d           |dz  }t          j        |d           dS dS )zGProvide two cycles where scale= and join= work, but redirect to kwargs.lines.linewidth?      ?   z

The `scale` parameter is deprecated and will be removed in v0.15.0. You can now control the size of each plot element using matplotlib `Line2D` parameters (e.g., `linewidth`, `markersize`, etc.).
rd   re   )	linewidthmarkeredgewidth
markersizezD

The `join` parameter is deprecated and will be removed in v0.15.0.z@ You can remove the line between points with `linestyle='none'`.rB   )	linestyle
N)r   rl   rcParamsro   rp   update)rP   scalejoinkwargslwmewmsrw   s           rY   _point_kwargs_backcompatz,_CategoricalPlotter._point_kwargs_backcompat   s    
""/036>Bs(CaB  M#!,,,,MMBMKKKz!!U   ,V +++4KCM#!,,,,,, "!rZ   c                     fd}| |dd|            |dd|           | d}d}t          j        |t          d	
           |fS )zFProvide two cycles where existing signature-level err_kws are handled.c                     |t           u rd S d| d|d}d|  d| d}t          j        |t          d           ||<   d S )	Nz
err_kws={'z': }z

The `zA` parameter is deprecated. And will be removed in v0.15.0. Pass `z` instead.
   re   r   ro   rp   rq   )namekeyvalsuggestrw   err_kwss        rY   deprecate_err_paramzD_CategoricalPlotter._err_kws_backcompat.<locals>.deprecate_err_param   sy    j  5C55C555G;D ; ;%,; ; ;  M#};;;;GCLLLrZ   Nerrcolorr2   errwidthr   r   zi

Passing `capsize=None` is deprecated and will be removed in v0.15.0. Pass `capsize=0` to disable caps.
rd   re   )ro   rp   rq   )rP   r   r   r   capsizer   rw   s    `     rY   _err_kws_backcompatz'_CategoricalPlotter._err_kws_backcompat   s    		 		 		 		 		 
GX>>>JX>>>?GB  M#};;;;rZ   c                     |t           ur$|}d|d}t          j        |t          d           |t           ur%|}d|  d}t          j        |t          d           ||fS )1Provide two cycles of backcompat for scale kwargsz\

The `scale` parameter has been renamed and will be removed in v0.15.0. Pass `density_norm=z` for the same effect.rd   re   z`

The `scale_hue` parameter has been replaced and will be removed in v0.15.0. Pass `common_norm=r   )rP   r   	scale_huedensity_normcommon_normrw   s         rY   _violin_scale_backcompatz,_CategoricalPlotter._violin_scale_backcompat  s    
"" LR27R R R  M#};;;;J&&#KW5>W W W  M#};;;;[((rZ   c                 z    |t           ur1|}t          d|d          }t          j        |t          d           |S )zGProvide two cycles of backcompat for violin bandwidth parameterization.z{

                The `bw` parameter is deprecated in favor of `bw_method`/`bw_adjust`.
                Setting `bw_method=z`, but please see docs for the new parameters
                and update your code. This will become an error in seaborn v0.15.0.
            rd   re   )r   r   ro   rp   rq   )rP   bw	bw_methodrw   s       rY   _violin_bw_backcompatz)_CategoricalPlotter._violin_bw_backcompat  sW    ZI $&    C
 M#};;;;rZ   c                     |t           ur4|}d|}|dk    r|dz  }n|dz  }t          j        |t          d           |S )r   zl

The `scale` parameter has been renamed to `width_method` and will be removed in v0.15. Pass `width_method=areaz<, but note that the result for 'area' will appear different.z for the same effect.rd   re   r   )rP   r   width_methodrw   s       rY   _boxen_scale_backcompatz+_CategoricalPlotter._boxen_scale_backcompat(  sl    
"" LJ@EJ J  UU..M#};;;;rZ   c                    |dk    r!d}t          j        |t          d           d}n|	|t          u rd}|dk    r|S |j        %|dS t
          j                            |          g}n#d |j                                        D             }t          j
        |d	          }d
 |D             }t          |          dz  }|||fS )zBAllow a color to be set automatically using a basis of comparison.grayzkUse "auto" to set automatic grayscale colors. From v0.14.0, "gray" will default to matplotlib's definition.rd   re   r3   Nc                 L    g | ]!}t           j                            |          "S r]   )rl   rm   to_rgb)r`   cs     rY   
<listcomp>z9_CategoricalPlotter._complement_color.<locals>.<listcomp>L  s(    QQQaSZ&&q))QQQrZ   r   r=   c                 <    g | ]}t          |d d          d         S )Nrd   r<   r   )r`   rgbs     rY   r   z9_CategoricalPlotter._complement_color.<locals>.<listcomp>N  s*    GGG#j#bqb'*1-GGGrZ   g333333?)ro   rp   rq   r   lookup_tablerl   rm   r   valuesnpuniquemin)	rP   r2   
base_colorhue_maprw   basisunique_colors
light_valslums	            rY   _complement_colorz%_CategoricalPlotter._complement_color8  s    F??C  M#};;;;EE]ew..EF??L'!tZ&&z223EEQQ73G3N3N3P3PQQQE	%a000GGGGG
*oo"S#rZ   c                     t           u r|                    ||          d| j        v rK| j        j        }t          t                    rd t          |          D             }nfd|D             }ndi}|S )zFSupport pointplot behavior of modifying the marker/linestyle with hue.r1   c                     i | ]\  }}||	S r]   r]   r_   s      rY   rc   z:_CategoricalPlotter._map_prop_with_hue.<locals>.<dictcomp>Z  s    ???DAq1a???rZ   c                     i | ]}|S r]   r]   )r`   ra   values     rY   rc   z:_CategoricalPlotter._map_prop_with_hue.<locals>.<dictcomp>\  s    4441e444rZ   N)r   rI   r6   _hue_maplevelsrh   listzip)rP   r   r   fallbackplot_kwsr   mappings     `    rY   _map_prop_with_huez&_CategoricalPlotter._map_prop_with_hueR  s    GLLx00EDN""])F%&& 5??C,>,>???4444V444UmGrZ   c           	         | j         |         dk    rdS | j        |         j        rdS t           t	          |d| d                                }|dk    r7|j                            d           |                    d|dz
  d	           dS |j                            d           |	                    |dz
  dd	           dS )
z0Set ticks and limits for a categorical variable.rA   Nget_ticksr/   Fg            ?)r3   )
rJ   rF   emptylengetattrxaxisgridset_xlimyaxisset_ylim)rP   axr>   ns       rY   _adjust_cat_axisz$_CategoricalPlotter._adjust_cat_axisb  s     >$=00F
 >$% 	F /.4...//11223;;HMM%   KKQV$K/////HMM%   KKB$K/////rZ   c                    t          | j        ddht          | j                  z            }d| j        v rR| j        |                                         }| j        g |d                                         }|j        |j        k    S dS )z3Return True when use of `hue` would cause overlaps.colrowr1   F)r   r?   rH   r6   rF   value_countssize)rP   groupersr?   paireds       rY   _dodge_neededz!_CategoricalPlotter._dodge_needed  s    eU3c$.6I6IIJJDN""^H-::<<F^$6h$6$67DDFFF;&+--urZ   c                 2   d| j         vrdS | j        j                            |d                   }t	          | j        j                  }|dxx         |z  cc<   |d         |z  }|d         |z  |d         dz  z   |dz  z
  }|| j        xx         |z  cc<   dS )z0Apply a dodge transform to coordinates in place.r1   Nwidthr   )r6   r   r   indexr   r?   )rP   keysr5   hue_idxr   
full_widthoffsets          rY   _dodgez_CategoricalPlotter._dodge  s    && F-&,,T%[99$%%W']Q&
g(4=1+<<zA~MT[V#rZ   r9   c                 N   |D ]}t          ||d                   \  }}|| j        k    rXd|v rT|d         dz  } |||         |z
            |d<    |||         |z             |d                                         z
  |d<   dD ] }| | x}	|v r |||	                   ||	<   !dS )z=Undo scaling after computation so data are plotted correctly.r   r   r   edge)rB   r   maxN)r   r?   to_numpy)
rP   r   r5   varsvar_invhwsufr   s
             rY   _invert_scalez!_CategoricalPlotter._invert_scale  s     	/ 	/C-b#a&99FAsdk!!goo']Q&"s49r>22V #DIN 3 3d6l6K6K6M6M MW) / /!=3==(CT11 #DIDI/	/ 	/rZ   c                    | j         dk    r| j         o
| j        dk    }nt          | j                   }|rO|                     ||||           |                                \  }}|r|                     | j                   d S d S d S )Nr3   r7   )semantic_kws)title)rM   rg   rE   booladd_legend_dataget_legend_handles_labelslegend_title)rP   r   func
common_kwsr   show_legendhandlesr   s           rY   _configure_legendz%_CategoricalPlotter._configure_legend  s    ;&  "11Qd6G66QKKt{++K 	3  T:L QQQ5577JGQ 3		 1	22222		3 	33 3rZ   c                     | j         | j                 dk    rdS t          j        | j        | j                           }t          |          dk    r't          j        t          j        |                    }nd}|S )zCReturn unit of width separating categories on native numeric scale.rA   r<   )rJ   r?   r   r   	comp_datar   nanmindiff)rP   unique_valuesnative_widths      rY   _native_widthz!_CategoricalPlotter._native_width  sp     >$+&-771 	$."=>>}!!9RW]%;%;<<LLLrZ   c                     d}d| j         v rq| j        j        et          | j        j                  }|r6||z  }t	          j        d||z
  |          }||                                z  }nt	          j        |          }|S )z3Return offsets for each hue level for dodged plots.Nr1   r   )r6   r   r   r   r   linspacemeanzeros)rP   r   dodgeoffsetsn_levels
each_widths         rY   _nested_offsetsz#_CategoricalPlotter._nested_offsets  s    DN""t}';'G4=/00H -"X-
+a);XFF7<<>>)(8,,rZ   c                    d| j         z  }|                     ||          }|du rd}nt          |          }d| j        v r*|r(| j        j        |t          | j        j                  z  }|| j         z  }t          t          j	        j
        | |
           }| j        g}	|r|	                    d           | j        }
dx}}d|v r=t          |d                                                   s|                    dd            |                     |	dd	          D ]\  }}|                     |          }
|H|dk                                    r0||d                             | j        j        j                           }t          |          d
k    r |t          |                    nd}|| j                 |z   |z   }||| j        <   |                     |
|            |
j        |d         |d         fd|i|}d| j        v r.|                    |                     |d                              |                     |
t4          |           d S )N皙?Tg?r1   )lowhighr   marker	edgecolorfrom_comp_dataallow_emptyr<   )r   r/   r0   r2   )r   )r  r  floatr6   r   r   r   r   r   randomuniformr?   appendr   r
   	is_filledrI   	iter_data	_get_axesanymapr   r   scatterset_facecolorsr  r   )rP   jitterr  r2   r   r   r  jlimjitterer	iter_varsr   
dodge_movejitter_movesub_varssub_dataadjusted_datapointss                    rY   plot_stripsz_CategoricalPlotter.plot_strips  sx    T''&&ue44T>>DD==DDN""u"1E1QC,---D""29,4%teDDD[M	 	$U###W#$$
[xHX4F(G(G(Q(Q(S(SLLd+++"&..@D=A #1 #C #C 	F 	FHh ))B"1'9'9';';"$Xe_%8%89M9S%T%TU
:=h--!:K:K((H6666QRK$T[1J>LM$1HT[!r8,,,RZx}VVEVXVVF&&%%dmmHUO&D&DEEEr#9hOOOOOrZ   c                     d j         z  }                     ||          } j        g}|r|                    d            j        i }d}	d|v r=t          |d                                                   s|                    dd                                 |dd          D ]\  }
} 	                    |
          |0||d         
                     j        j        j                           }	|j        s| j                 |	z   | j        <                        |            j        |d         |d	         fd
|i|}d j        v r.|                                         |d                              |j        s||| j                 j        d         f<   t)          | j        |          |                                D ]P\  \  }}|                                j        d         dk    r%|d fd
}|                    |          |_        Qt5          j                                        t:          |           d S )Nr  r1   r   r  r  Tr  r/   r0   r2   )r   r?   warn_threshr<   )centerc                    | |           	j         dk    rd}                                }n                                }d}	j        	j                  dk    }                    |                     j                             |s|s|r                    ||           t          | j	        |           
                    |           d S )Nr0   FrA   scalexscaley)r?   get_autoscaley_onget_autoscalex_onrJ   update_datalimget_datalim	transDataautoscale_viewrC   rX   draw)
r/  rendererr3  r6  r7  fixed_scalerX   r   beeswarmrP   s
         rY   r>  z-_CategoricalPlotter.plot_swarms.<locals>.draw4  s    HVV,,,{c))!&!#!5!5!7!7!#!5!5!7!7!& #'."="NK%%f&8&8&F&FGGG& HF Hf H)))GGG&*F3388BBBBBrZ   )r  r  r?   r  r   r
   r  rI   r   r!  r#  r   r   r   r   r   r$  r6   r%  ilocBeeswarmrj   get_offsetsshape__get__r>  r   figurer  r   )rP   r  r2   r2  r   r   r  r)  point_collectionsr*  r,  r-  r/  r3  r>  r   rA  rX   s   `              @@rY   plot_swarmsz_CategoricalPlotter.plot_swarms  s    T''&&ue44[M	 	$U###W
xHX4F(G(G(Q(Q(S(SLLd+++"&..@D=A #1 #C #C 	P 	PHh ))B"$Xe_%8%89M9S%T%TU
> K(0(=
(J%r8,,,RZx}VVEVXVVF&&%%dmmHUO&D&DEEE> PIO!2x'<'A!'D"EF%UUU$5$;$;$=$= 	3 	3 LR&!!##)!,q005; C C C C C C C C C C, #ll622RYr#98DDDDDrZ   c                   
 dg}ddd| j                  }t          j        j        f
fd	}|s|t          j        d         }
                    dt          j        d                   }
                    d	
                    d
d                     |rt          j        j        nt          j        j        } |d|           |d           |d           |d           |d          d}|d                             dd           |d                             dd           |d                             d|	           | j	        }| 
                    |dd          D ]]\  }}|                     |          }|                    | j                   |         }t          || j                                                                      t                               }d |D             }t#          j        t          j                            |||                    }|| j        z  }t#          j        | j         |d|i          }|r|                     ||           |r|dxx         d|z
  z  cc<   
                    dd|d         z            }|                     ||           t3          ||          \  }}dD ]} |||                   ||<   |d                             |          |d<    t7          |d| j          d                       d!k    }d|v r|                     |d                   n|}|r>||d"|d         } d#|i|d         }!d#|i|d         }"d$|i|d         }#d#|i|d         }$n<d#|i|d         } d#|i|d         }!d#|i|d         }"d$|i|d         }#d#|i|d         }$|| |!|"|$fD ]}%|%                    d%|           t;          d1|                    d&          || j                  |r|d         nd'|| j         dk    d| |!|"|#|$d(t?          t          d)          ri nd|i}&i |&
}' |j         d1i |'}(ddg!                    | j                   })|s2tE          |                    d&                    D ]\  }*}+|+d*         },|+d*         |+d         z   }-|(d+         r|(d+         |*         }|r|#                                j$        j%        }.n|&                                }.|,|.|)         d'<   |,|.|)         d,d <   |-|.|)         dd,<   |s|'                    |.           |(                    tS          j*        |.          | j         dk    | j         dk    -           |(d.         rU|(d.         |*         +                                j%        }/|,|-f|/|)         d d <   |(d.         |*         '                    |/           |(d/         rt3          || j                   \  }0}1|(d/         d0|*z  d0|*z  d0z            D ]}2 |1 |0|+| j                            ||*         d0z  z
            }, |1 |0|+| j                            ||*         d0z  z             }-|2+                                j%        }/|,|-f|/|)         d d <   |2'                    |/           |,                    t[          |(                     _t]          |          }3| /                    ||3|            d S )2Nr1   r0   r/   r9   c                 R    t                              |  di           |          S )Nprops)r   rI   )elementartistr   s     rY   	get_propsz1_CategoricalPlotter.plot_boxes.<locals>.get_props`  s*    #HLLG1B1B1BB$G$GPPPrZ   r}   	bootstrapzboxplot.bootstrapshownotchesnotchFboxmedianwhiskerfliercap)rS  rT  rU  rV  rW  solid_capstylebuttr   Tr  c                 <    g | ]\  }}|                                 S r]   )r   )r`   r   r/   s      rY   r   z2_CategoricalPlotter.plot_boxes.<locals>.<listcomp>  s$    ;;;41a!**,,;;;rZ   )whisrP  r   r<   	capwidthsr   )r  medq1q3cilocihiwhislowhishifliersr   r   linear	facecolorr  r2   markeredgecolorr   recordsr   )bxpstats	positionswidthspatch_artistvertmanage_ticksboxpropsmedianpropswhiskerprops
flierpropscappropsz3.6.0r   boxesrd   updatexupdateymedianscapsr   r]   )0r?   rl   linesLine2Dr   rI   
setdefaultpatchesr   r   r   r!  groupbysortedr   astyper  pd	DataFramecbookboxplot_statsr  r   rL   r   r   r#  r   r   ri   to_dictr   bxpr   	enumerateget_pathverticesTget_dataset_datar:  r   	transpose
get_xydataadd_containerBoxPlotContainerr   r  )4rP   r   r  gapfillr[  r2   	linecolorr   	fliersizer   r)  	value_varrO  rP  
box_artistrL  r   r,  r-  groupedrk  
value_datastats
orig_widthr5   capwidthr   r   statlinear_orient_scale	maincolorrp  rq  rr  rs  rt  	prop_dictdefault_kwsboxplot_kwsartistsori_idxirS  p0p1	box_vertsvertsf_fwdf_invlinelegend_artists4             `                                         rY   
plot_boxesz_CategoricalPlotter.plot_boxesO  s    G	C((5	&)i&6 	Q 	Q 	Q 	Q 	Q 	Q  	8	)%67ILLcl;N.OPP	M8<<+G+GHHH.2HS[**	8H
9UJ//i)) y++Yw''9U##
 
 	h""#3V<<<i##$4f===g!!,	:::W"&..@D=B #1 #D #D o	8 o	8Hh ))B&&t{33I>Gx4;;==DDUKKLLI;;7;;;JL!8!8$CL "9 "N "N O OE !33J<i* MNND ,Hd+++ )WS(||KtG}1DEEHr4(((-b)<<FAsW / /!c%+..d#Ho11#66E(O"H'".GT[.G.G.G"H"H"J"Jh"V:?8:K:Khuo666QVI @!* FKEl  '	EU8_E 'GeI6FG/MeGnM
#Y?%,?#Y?%,?&	EU8_E 'GeI6FG/MeGnM
#Y?%,?$"*Kx!P A AI((i@@@@ y11t{+(;BtG}}![C'"!')%!   ,C99 1BB%x0# K( 6[5H5Kbf++{++G Cj&&t{33G& #1'Y(?(?@@ "1 "1FAsVBVs7|3Bw' %,W%5a%8
 >(2(;(;(=(=(F(HII(2(;(;(=(=I02	'*1-13	'*122.24	'*1Q3/# ;&//	:::))L33$(K3$6$(K3$6 *    y) > '	 21 5 @ @ B B D,.Fgqqq)	*1-66u===v 1'?DK'P'Pu$+FOAE!a%!)O$D 1 1D!&uuS-='>'>!q'P!Q!QB!&uuS-='>'>!q'P!Q!QB$(OO$5$5$7E02BE'N111- MM%0000-g667777066r=(;;;;;rZ   c           	         | j         dg}ddd| j                  }t          |	|
|          }g d}t          d||           ||ni ||}|i n|                                }|i n|                                }|*|rdt          j        d         z  }nt          j        d         }| j        }|                     |d	d
          D ]i\  }}|                     |          }t          || j                   \  }}t          ||          \  }} |||                   }|d         dz  dz
  }|d         }t          j        | j         || j                  gd|| j        z  gi          }|r|                     ||           |r|dxx         d|z
  z  cc<   |d         }|dz
  |d         z
                      t                    } |dk    r|dz   }!nD|dk    rd| z  }!n8|dk    r2||d         dz
  k     }"d| |"z
  z  t!          j        |d                   z  }!|| j                                                  }#|!|!                                z  |d                                         z  }$ ||          }% ||#|$dz  z
            }& ||dd                     ||d d                   z
  }' ||#|$dz  z              ||#|$dz  z
            z
  }(d|v r|                     |d                   n|})d|rdn|)d}*|r&t+          |)d	          }+ |+d| dz   dz  z            },n|)},g }-t-          |          D ]r}.| j         dk    r!|&|.         |%|.         f}/|(|.         |'|.         }1}0n |%|.         |&|.         f}/|'|.         |(|.         }1}0|-                    t1          |/|0|1                     s|r|,|d}2nd|,d}2i |2d|i|}3|                    t5          |-fi |3d
           |                    t!          j        |%|%g          | j         dk    | j         dk               |d         }4|d                                         dz  }5| j         dk    r! ||#|5z
  |#|5z   g           ||4|4g          }7}6n  ||4|4g           ||#|5z
  |#|5z   g          }7}6|r|n|)d d!|z  d"}8 |j        |6|7fi i |8| |r ||d#                   }t!          j        t?          |           ||| j                                                                      }9| j         dk    r|9|fn||9f\  }6}7 |j         |6|7fi i |*d$d%i| k|!                    | j         dk    | j         dk    &           tE          |          }:i |||d'};| #                    ||:|;           d S )(Nr1   r0   r/   r9   )exponentialre  r   r   r   r}   TFr  ra   r   r<   r   r   r   re  r  r   nonez.45rf  )as_cmaprd   )
facecolors
edgecolorsr   autolimrv  rT  rY        ?)r2   rX  r   rd  s   r5  r   r  )$r?   r   r   copyrl   r   r   r   r!  r   r  r  r  r   r  r  r   r  itemr   r   r   ranger  r   add_collectionr	   r:  column_stackplotfullr   r$  r=  r   r  )<rP   r   r  r  r  r2   r  r   r   k_depthoutlier_proptrust_alpha
showfliersbox_kws	flier_kwsline_kwsr   r)  r  	estimatorwidth_method_optionsr   r,  r-  r   inv_oriinv_vallv_datar   valspos_datar   exponent
rel_widthstailsr3  rl  box_valsbox_posbox_heights
box_widthsr  flier_colorscmap	boxcolorsboxenr  xywr8   
box_colorscollection_kwsr]  r   r/   r0   r  posr  r   s<                                                               rY   plot_boxensz_CategoricalPlotter.plot_boxens  s   ( [%(	C((5	 ,DD	@@@(<lKKK%o((3Jh3J'3J#+BB1A1A	!)22x}} <#,/@"AA		L):;	W"&..@D=B #1 #D #D ]	K ]	KHh ))B1"dkBBJAw1"i@@JAw  i 344Gq 1$A8$D|ht{34%$"445%  H  0Hh/// -!!!QW,!!! X&F
WS\199%@@Hx''#aZ

..(]

'''#,"238e#34rwwx?P7Q7QQ
dk*//11F*.."2"22Xg5F5K5K5M5MMFwt}}Hgfvz122G!'$qrr(++ggd3B3i.@.@@K &1*!455RS@S8T8TTJ:?8:K:Khuo666QVI#42N%%Y L  &$Y=== D1'9!:;;		%	E1XX 2 2;#%%!!*hqk2B&qM;q>qAA"1+wqz2B'NJqMqAYr1a001111 M,5YOO

,2)LL
N
NKNNgNNoeFF~FFPUVVV8 455s*s*     (#C'"''))A-B{c!!wVb[9::GGS#J<O<O1wSz**GGVb[&2+4N,O,O1&*9	"(!I- K
 BGAq887{7h7888  Kwwx011gc$ii$+1F1K1K1M1M)N)NOO&*kS&8&8T{{tSk1
1aJJ#Il#IC#I#Iy#IJJJ
!3DK3<NOOO066PPiiPPP
r=*=====rZ   c                    OPQR  j         dg}ddd j                  }g d}t          d||	d           t          d	g d
|
           |*|rdt          j        d         z  }nt          j        d         }|	j|	                    d          rU|                    d|dz            }|                    d|dz            }|                    d j         dk    rdnd          }t          dOi |} j        }g R                     |dd          D ]\  }}|	                    dd          |d<   |
                    ||g           }d|v r                     |d                   n|}|s|}d}t          |||          }R                    | j                  ||         |d         ||         i |||                     |          d            fdQQfd RD             }|rYt          j        d! RD                       Pt          j        d" RD                       OPfd#|D             }Ofd$|D             }n^t#          j                    5  t#          j        d%d&           QRfd'|D             }d d d            n# 1 swxY w Y   QRfd(|D             }| j        z  }RD ]} t+          j        d)t/          t1          | d*                   d                    }!t+          j         j         | d+         || d*         d| d         d,|i|!-          }"|r                     | d.         |"           |r|"d,xx         d|z
  z  cc<    Q| d.                   }#|"d,         d/z  }$| d                                         }%t          j        |%          rd}&n\|
d0k    r|"d         ||#         z  }&nD|
d1k    r-t1          | d2                   }'|"d         |%z  |'||#         z  z  }&n|
d,k    r|"d         |%z  }&|&|$z  |rd/ndz  }&d j        vrd)n- j        j                            | d.         d                   d/z  }(|r|(r|$|&|$z
  fn|&|$z
  |$f})n|&|&f})| d3         }t?          |d          \  }*}+t?          |d          \  }*},|+|,d j                  }-|+|,d|         }.| d4         d5         }t          j        |%          r|" j                  j         d)         }/| d2         !                                }0 j         dk    r|/|)d)         z
  |/|)d         z   g|0|0g}2}1n|0|0g|/|)d)         z
  |/|)d         z   g}2}1|"                     |+|1           |,|2          ||6           |j#        |j$        d j                  }3 |3 |.|"|                    |-|" j                  |)d)         z
             |-|" j                  |)d         z             fi | d4          | d2         }4 j         | d+         d,|i}5|r                     | d.         |5           |r|5d,xx         d|z
  z  cc<   |	t|	                    d7          rt          j%        |5 j                  gt1          |4          z            }/|r|/|(rd8nd|5d,         z  d/z  z  }/ j         dk    r|/|4fn|4|/f\  }1}2|||d/z  d/z  | d4         	                    d9d/          dz   d:|}6 |j&         |+|1           |,|2          fi |6 5|	                    d;          r2t          j'        |4|"|         |" j                  |)d)         z
            }7t          j'        |4|"|         |" j                  |)d         z             }8t          j(         |-|7           |-|8          g          }9t          j(         |.|4           |.|4          g          }:t          j(        |9|:g          )                    d/dd)          }; j         dk    r|;d d d d d d d8f         };||d/z  d6|}6t          j*        j+        |;fi |6}<|,                    |<d<           }|	                    d=          rEt          j-        |4g d>          }=t          j'        |=|"|         |" j                  |)d)         z
            }7t          j'        |=|"|         |" j                  |)d         z             }8t          j(         |-|7           |-|8          g          }9t          j(         |.|=           |.|=          g          }:t          j(        |9|:g          )                    d/d)d          }; j         dk    r|;d d d d d8d d f         };g d?}>t]          |;          D ] \  }?}@|||>|?         d@|}6 |j"        |@i |6 !|	                    d          rt          j/        0                    |4          d)         }=t          j%        |5 j                            }/|r|/|(rd8nd|5d,         z  d/z  z  }/|/|/g|/|/g|/gf}/|=dA         |=dB         g|=dC         |=dD         g|=dE         gf}0 j         dk    r|/|0c\  }A}B}C\  }D}E}Fn|0|/c\  }A}B}C\  }D}E}F|rZ|(rdnd8|z  dFz  d/z  }G j         dk    r|Gd)fnd)|G f\  }H}I|j1        t          j2        3                    |H|I|j4        j5                  z   }Jn|j1        }J||JdG|dH|i}K |j"         |+|A           |,|D          fi |K ||KdH<    |j"         |+|B           |,|E          fi |K ||dIz  |dJz  |JdK|dLdL|dM}L |j"         |+|C           |,|F          fi |L tm          |          }Mi |||dN}N 7                    ||M|N           d S )PNr1   r0   r/   r9   )rS  quartstickpointNinnerT)prefixr   )r   countr   r  zpatch.linewidthr}   rS  	box_widthg      @
whis_widthrd   r  r   |Fr  weightsr<   weightr  )rg  r  r   density)positionobservationsr  supportr   r,  r   c                 ^    t          fd|                                 D                       S )Nc              3   <   K   | ]\  }}|j         k    ||fV  d S N)r?   )r`   ra   rb   rP   s      rY   	<genexpr>zH_CategoricalPlotter.plot_violins.<locals>.vars_to_key.<locals>.<genexpr>  s7      QQDAqT[@P@P!Q@P@P@P@PQQrZ   )tuplerj   )r,  rP   s    rY   vars_to_keyz5_CategoricalPlotter.plot_violins.<locals>.vars_to_key  s0    QQQQHNN,<,<QQQQQQrZ   c                 2    g | ]} |d                    S )r,  r]   )r`   violinr  s     rY   r   z4_CategoricalPlotter.plot_violins.<locals>.<listcomp>  s(    OOO[[
!344OOOrZ   c                 B    g | ]}|d                                           S )r  r   r`   rb   s     rY   r   z4_CategoricalPlotter.plot_violins.<locals>.<listcomp>  s(    +T+T+T1AiL,<,<,>,>+T+T+TrZ   c                 8    g | ]}t          |d                    S )r  r   r  s     rY   r   z4_CategoricalPlotter.plot_violins.<locals>.<listcomp>  s%    )V)V)VQ#a.?*@*@)V)V)VrZ   c                     i | ]}|S r]   r]   )r`   r   common_max_densitys     rY   rc   z4_CategoricalPlotter.plot_violins.<locals>.<dictcomp>  s    HHHs3 2HHHrZ   c                     i | ]}|S r]   r]   )r`   r   common_max_counts     rY   rc   z4_CategoricalPlotter.plot_violins.<locals>.<dictcomp>  s    DDD3.DDDrZ   ignorez All-NaN (slice|axis) encounteredc                 V    i | ]$t          j        fd D                       %S )c                 n    g | ]1} |d                    k    |d                                          2S )r,  r  r  r`   rb   r   r  s     rY   r   z?_CategoricalPlotter.plot_violins.<locals>.<dictcomp>.<listcomp>  sL     $ $ $/0&;q}55<< )((**<<<rZ   r   nanmaxr`   r   r  violin_datas    @rY   rc   z4_CategoricalPlotter.plot_violins.<locals>.<dictcomp>  se          $ $ $ $ $4?$ $ $    rZ   c                 V    i | ]$t          j        fd D                       %S )c                 d    g | ],} |d                    k    t          |d                   -S )r,  r  r  r  s     rY   r   z?_CategoricalPlotter.plot_violins.<locals>.<dictcomp>.<listcomp>  sI          /0"{1Z=11S88 .)**888rZ   r  r	  s    @rY   rc   z4_CategoricalPlotter.plot_violins.<locals>.<dictcomp>  se         RY          4?         rZ   r   r  r  r   )r   r,  r   r   r  r  r   r   r  )r2   r   r  r  zorder)r2   r  r  r  r  r  r  )r  2   K   )r  r   )g      @r<   r  )r2   r   dashesrb  rc  r^  r_  r]  H   )r2   	transformr   g333333?   )r  r   r   r  r  )rh  markerfacecolorr2   r  r]   )8r?   r   rl   r   
startswithrI   r   r   r   rL   
_transformr   ri   r  r!  r   r  ro   catch_warningsfilterwarningsr  r  
RangeIndexr   r   r  r   isnanr6   r   r   r   rB  r  r  fill_betweenxfill_betweenarrayr$  interpstackr  collectionsLineCollectionr  
percentiler  r  r  r<  
transformsScaledTranslationrG  dpi_scale_transr   r  )SrP   r   r  r  splitr2   r  r  r   r  r   r   kde_kws	inner_kwsr   r)  r  inner_optionsr  r  r  kder   r,  r-  	stat_datar  r  	norm_keysmax_density	max_count
real_widthr  r   r5   norm_keyr   peak_densityspanr  
right_sider  r   invxinvyinv_posr  r  r   r/   r0   	plot_funcobspos_dictkwspos0pos1pos_ptsval_ptssegmentsr{  r  r  r  segmentx0x1x2y0y1y2r   dxdytransr  dot_kwsr  r   r  r   r  r
  sS   `                                                                              @@@@rY   plot_violinsz _CategoricalPlotter.plot_violinsx  s   $ [%(	C((5	@@@dCCCC(B(B(BLQQQ < 3<0A#BB		L):;	!1!1%!8!8!k9s?CCI"|Y]CCJ]]8DK34F4FSSCPPFnnGnnW #'..@D=B #1 #D #D 	 	Hh "*i!;!;HXxB??I:?8:K:Khuo666QVI #%	"	###  K $T[1 ( 3$Y/$Y/5[5H5$nnX..       	R 	R 	R 	R 	R POOO;OOO	 	!#+T+T+T+T+T!U!U!y)V)V+)V)V)VWWHHHHiHHHKDDDD)DDDII(**  '2TUUU     #,	                     (	  I T//
 " l	7 l	7FM!SVI->)?)?%C%CDDE<VJ/6),6),	!
   D  6F:.555 )WS( #{6*#566Hg"B!),0022Lx%% 6''IX)>>((F>233I58AT9TU((I5"9U 12D $.00])//z0B50IJJQN   %-7L2tby//dRi_*B.r377GAt.r377GAt t,,T[9G t,,Y7Gx(5I x%% 4;',Q/^,1133;#%%'!*,cGAJ.>?#sqAA:gaj(8#
:J'KqAQa	YOOO !.R_EEdkRIIY((T[)GAJ677T[)GAJ677  "	   (CVJ%7*MH :F:.999 /!!!a#g.!!! }!!'** \7h 56SABB M*3BB!x7HH1LLC%)[C%7%7Szzc3Z1&!*#a-A-$X.228Q??!C	 
   
4477DDGG33s3333!!'** N7yd9otDK7H7ST:7UVVyd9otDK7H7ST:7UVV(GGDMM774==#ABB(GGCLL''#,,#?@@8Wg$677AA!QJJ;#%%'111ddd
3H&!*Q   
 6xGG3GG!!%!7777!!'** >7c<<<88yYdk9JWUVZ9WXXyYdk9JWUVZ9WXX(GGDMM774==#ABB(GGENNGGENN#CDD8Wg$677AA!QJJ;#%%'44R4
3H==="+H"5"5 - -JAw!*%."()  $	C BGW,,,,,- !!%(( +7	//44Q7hx455 M*3BB!x7HH1LLCCj3*se38_eHo64[%+.5\N
 ;#%%14c.LRR,2r2214c.LRR,2r2 )#-5aa2BRG!KF,0K3,>,>fa[[QLFBL3>+K+KB	 9, , EE LE&!&     	  R$$r((77h777(1%R$$r((77h777$"+c/'01}!&		 	
  	 (+'*&	 	 	 R$$r((66g666066QQyyQQQ
r=*=====s   %J  JJc	           	         ddd| j                  }	dg}
t          |t          j        j                  }|                    dt          j        d         dz             |                    d|d         d	z             |                    d
|d         t          j        dt          j	        z            z             | 
                    d|d|          }| 
                    d|d|          }| j        | j                  }| j        | j                  dk    rt          | j        | j                                                            }t          | j        | j                                                            }d t#          ||dz             D             }| j        j        dnt)          | j        j                  }|du rd|z  }| j        }|                     |
dd          D ]T\  }}|                     |          }t1          || j          d          }t3          || j                   \  }} ||                    |                    }|j        r|nq |                    | j                   j        ||	fi t=          d                              tA          j!        || j                             "                                }|rV| j        j        #                    |d                   }||dz
  z  }| dz  ||z  z   }|| j         xx         || j$        z  z  cc<   | %                    ||           |&                                }|'                    ||(                    d                   ||(                    d                   d|v r|                     |d                   n|            |j)        |d         |d         fi |\  }|&                                }|*                                }dD ]}|                    |||                    |j+        | ,                    ||||           Vt[          t          j        j        g g           }d||di} | .                    ||||            d S )Nr0   r/   r9   r1   r   r}   r~   r   r   r   r   r  or   -rA   c                     g | ]}|S r]   r]   )r`   r  s     rY   r   z3_CategoricalPlotter.plot_points.<locals>.<listcomp>  s    MMMAaMMMrZ   r<   r   Tg?r  r>   F)r   )r  r   r2   )r2   r   alphar  )r  r   )/r?   r   rl   r{  r|  r}  r   r   sqrtpir   rO   rJ   intr  r   r   r  r   r   r   r   r   r!  r   r   convert_unitsr   r  applyr   reindexr  Indexreset_indexr   r  r   r  r   rL   r  
propertieserror_methodplot_errorbarsr   r  )!rP   
aggregatormarkers
linestylesr  r2   r   r   r   agg_varr)  base_positionsmin_cat_valmax_cat_valn_hue_levelsr   r,  r-  ori_axisr  r   rk  agg_datar   	step_sizer   sub_kwsr  sub_err_kws
line_propspropr  r   s!                                    rY   plot_pointsz_CategoricalPlotter.plot_points  s}    #&&t{3G	#Hci.>??K6G)H3)NOOO-x/Dt/KLLLL(;*?"'!be)BTBT*TUUU))(GS(KK,,[*c8TT
5>$+&-77dnT[9==??@@KdnT[9==??@@KMM{K!O)L)LMMMN M08qqc$-BV>W>WD==<'EW"&..@D=A #1 #C #C '	H '	HHh ))Brdk#7#7#788H3BDDLIq!	("8"8"H"HIII#+> xx%%z7S S.J5.Q.QS S )$+>>>??   E-.44Xe_EE!\A%56	!i'&99%%%$2D)DD%%%r8,,,mmooGNNx||E223$X\\%%8%898=8I8IdmmHUO444u     BGHSM8C=DDGDDED!,,..K**JA ? ?&&tZ-=>>>>&2##B';GGG	 0"b99'
KKLr='<HHHHHrZ   c
                 D   ddd| j                  }
dg}| j        }| j        j        d}|r||t	          | j        j                  z  }|s)|	                    ddt          j        d         z             |                    ddt          j        d         z             |                     |d	d	
          D ]\  }}| 	                    |          }|j
        r|nE |                    | j                   j        ||
fi t          d                                          }|| j        z  |d<   |r|                     ||           |r|dxx         d|z
  z  cc<   || j                  |d         dz  z
  |d<   |                     ||           | j         dk    r,|j        }t'          |d         |d         |d                   }n+|j        }t'          |d         |d         |d                   }d|v r|                     |d                   n|}d|d<   |r|                    ||           n|                    ||d            |di i ||	 |j         |                     |||d|rdn|i|           t1          |          }|                     |||	           d S )Nr0   r/   r9   r1   Fr         ?r}   Tr  r   r<   r   r   )r/   heightr   )r0   r   ro  align)r2   rg  r  )r2   r  rg  r2   z.26r]   )r?   r   r   r   r   r}  rl   r   r   r!  r   r  rV  r   rY  r  r   r   barri   barhr   r[  r\  r   r  )rP   r]  r  r  r   r  r2   r   r   r   r`  r)  r   r,  r-  rf  bar_funcr;  
main_colorr  s                       rY   	plot_barsz_CategoricalPlotter.plot_bars  sD    #&&t{3G	W='E 	:W(DM$8 9 99G 	TS3<@Q3R-RSSS;cl;L.M(MNNN"&..@D=A #1 #C #C 0	 0	Hh ))B#+> xx%%z7S S.J5.Q.QS S 	  !&(: :HW 0Hh/// -!!!QW,!!!'4x7H17LLHVr8,,,{c!!6v&x}HWDU   7v&hsmHWDU   <AH;L;Lx777RWJ "CL U

z
BBBB

zV
TTTH++*#**+++&2##'t;eeGwG  
 166r=(;;;;;rZ   c           	         ddd| j                  }|                    d          D ]c}t          |          }t          j        || j                  || j                  g          }t          j        || d         || d         g          }|r|| j        z  dz  }	t          || j                   \  }
} | |
|d                   |	z
             | |
|d	                   |	z             f}t          j        g |t          j        |t          j        g|g          }t          j        |d         |d         t          j        g|t          j        |d
         |d
         gg          }| j         dk    r||f}n||f} |j	        |i | ed S )Nr0   r/   r9   ri  r   r   r   r   r<   r  )
r?   r  ri   r   r  r  r   concatenatenanr  )rP   r   r5   r   r   r   r   r  r   cwsclr   rW  argss                 rY   r\  z"_CategoricalPlotter.plot_errorbars.  s   c""4;/<<	** 	& 	&Cs))C(C,c$+.>?@@C(C3,cS+++.>?@@C t11A53BDDSc##c!f++*++SSSVr1A-B-BBn"cN26NC"&3&   nVSVRV,cBFCGSW3M&   {c!!CxCxBGT%W%%%%/	& 	&rZ   )F)r9   )NN)!__name__
__module____qualname__wide_structureflat_structure_legend_attributesrD   rx   r{   r   r   r   r   r   r   r   r   r   r   r   r  propertyr  r  r0  rI  r  r  rL  rl  ru  r\  __classcell__)rX   s   @rY   r,   r,   1   s0       %IjIIN9%N! L2 L2 L2 L2 L2 L2\3" 3" 3" 3"j  (- - -<     6) ) )(
 
 
     4   0 0 0>  $ $ $
/ 
/ 
/ 
/	3 	3 	3 	3   X  &1P 1P 1PfHE HE HE HE HETZ< Z< Z<xK> K> K>ZR> R> R>hNI NI NI`P< P< P<d& & & & & & &rZ   r,   c                       e Zd ZdddZdS )_CategoricalAggPlotterz@indexr-   r9   N)r|  r}  r~  r  r]   rZ   rY   r  r  K  s        #)44NNNrZ   r  categorical_narrativeaL      See the :ref:`tutorial <categorical_tutorial>` for more information.

    .. note::
        By default, this function treats one of the variables as categorical
        and draws data at ordinal positions (0, 1, ... n) on the relevant axis.
        As of version 0.13.0, this can be disabled by setting `native_scale=True`.
    input_paramsz    x, y, hue : names of variables in `data` or vector data
        Inputs for plotting long-form data. See examples for interpretation.    categorical_dataz    data : DataFrame, Series, dict, array, or list of arrays
        Dataset for plotting. If `x` and `y` are absent, this is
        interpreted as wide-form. Otherwise it is expected to be long-form.    
order_varsz    order, hue_order : lists of strings
        Order to plot the categorical levels in; otherwise the levels are
        inferred from the data objects.    stat_api_paramsa      estimator : string or callable that maps vector -> scalar
        Statistical function to estimate within each categorical bin.
    errorbar : string, (string, number) tuple, callable or None
        Name of errorbar method (either "ci", "pi", "se", or "sd"), or a tuple
        with a method name and a level parameter, or a function that maps from a
        vector to a (min, max) interval, or None to hide errorbar. See the
        :doc:`errorbar tutorial </tutorial/error_bars>` for more information.

        .. versionadded:: v0.12.0
    n_boot : int
        Number of bootstrap samples used to compute confidence intervals.
    seed : int, `numpy.random.Generator`, or `numpy.random.RandomState`
        Seed or random number generator for reproducible bootstrapping.
    units : name of variable in `data` or vector data
        Identifier of sampling units; used by the errorbar function to
        perform a multilevel bootstrap and account for repeated measures
    weights : name of variable in `data` or vector data
        Data values or column used to compute weighted statistics.
        Note that the use of weights may limit other statistical options.

        .. versionadded:: v0.13.1    ciz    ci : float
        Level of the confidence interval to show, in [0, 100].

        .. deprecated:: v0.12.0
            Use `errorbar=("ci", ...)`.    r?   a      orient : "v" | "h" | "x" | "y"
        Orientation of the plot (vertical or horizontal). This is usually
        inferred based on the type of the input variables, but it can be used
        to resolve ambiguity when both `x` and `y` are numeric or when
        plotting wide-form data.

        .. versionchanged:: v0.13.0
            Added 'x'/'y' as options, equivalent to 'v'/'h'.    r2   zS    color : matplotlib color
        Single color for the elements in the plot.    rr   aC      palette : palette name, list, dict, or :class:`matplotlib.colors.Colormap`
        Color palette that maps the hue variable. If the palette is a dictionary,
        keys should be names of levels and values should be matplotlib colors.
        The type/value will sometimes force a qualitative/quantitative mapping.    hue_normz    hue_norm : tuple or :class:`matplotlib.colors.Normalize` object
        Normalization in data units for colormap applied to the `hue`
        variable when it is numeric. Not relevant if `hue` is categorical.

        .. versionadded:: v0.12.0    
saturationz    saturation : float
        Proportion of the original saturation to draw fill colors in. Large
        patches often look better with desaturated colors, but set this to
        `1` if you want the colors to perfectly match the input values.    r   z[    capsize : float
        Width of the "caps" on error bars, relative to bar spacing.    r   z    errcolor : matplotlib color
        Color used for the error bar lines.

        .. deprecated:: 0.13.0
            Use `err_kws={'color': ...}`.    r   z    errwidth : float
        Thickness of error bar lines (and caps), in points.

        .. deprecated:: 0.13.0
            Use `err_kws={'linewidth': ...}`.    r  zw    fill : bool
        If True, use a solid patch. Otherwise, draw as line art.

        .. versionadded:: v0.13.0    r  z    gap : float
        Shrink on the orient axis by this factor to add a gap between dodged elements.

        .. versionadded:: 0.13.0    r   z    width : float
        Width allotted to each element on the orient axis. When `native_scale=True`,
        it is relative to the minimum distance between two values in the native scale.    r  av      dodge : "auto" or bool
        When hue mapping is used, whether elements should be narrowed and shifted along
        the orient axis to eliminate overlap. If `"auto"`, set to `True` when the
        orient variable is crossed with the categorical variable or `False` otherwise.

        .. versionchanged:: 0.13.0

            Added `"auto"` mode as a new default.    r   zR    linewidth : float
        Width of the lines that frame the plot elements.    r  zy    linecolor : color
        Color to use for line elements, when `fill` is True.

        .. versionadded:: v0.13.0    	log_scalea      log_scale : bool or number, or pair of bools or numbers
        Set axis scale(s) to log. A single value sets the data axis for any numeric
        axes in the plot. A pair of values sets each axis independently.
        Numeric values are interpreted as the desired base (default 10).
        When `None` or `False`, seaborn defers to the existing Axes scale.

        .. versionadded:: v0.13.0    native_scalez    native_scale : bool
        When True, numeric or datetime values on the categorical axis will maintain
        their original scaling rather than being converted to fixed indices.

        .. versionadded:: v0.13.0    	formatterz    formatter : callable
        Function for converting categorical data into strings. Affects both grouping
        and tick labels.

        .. versionadded:: v0.13.0    rM   a      legend : "auto", "brief", "full", or False
        How to draw the legend. If "brief", numeric `hue` and `size`
        variables will be represented with a sample of evenly spaced values.
        If "full", every group will get an entry in the legend. If "auto",
        choose between brief or full representation based on number of levels.
        If `False`, no legend data is added and no legend is drawn.

        .. versionadded:: v0.13.0    r   z    err_kws : dict
        Parameters of :class:`matplotlib.lines.Line2D`, for the error bar artists.

        .. versionadded:: v0.13.0    ax_inzh    ax : matplotlib Axes
        Axes object to draw the plot onto, otherwise uses the current Axes.    ax_outzY    ax : matplotlib Axes
        Returns the Axes object with the plot drawn onto it.    r%   zH    boxplot : A traditional box-and-whisker plot with a similar API.    r&   zL    violinplot : A combination of boxplot and kernel density estimation.    r#   z    stripplot : A scatterplot where one variable is categorical. Can be used
                in conjunction with other plots to show each observation.    r$   z    swarmplot : A categorical scatterplot where the points do not overlap. Can
                be used with other plots to show each observation.    r)   zK    barplot : Show point estimates and confidence intervals using bars.    r*   zL    countplot : Show the counts of observations in each categorical bin.    r(   zM    pointplot : Show point estimates and confidence intervals using dots.    r"   zG    catplot : Combine a categorical plot with a :class:`FacetGrid`.    r'   z<    boxenplot : An enhanced boxplot for larger datasets.    r   Tr3   r  rn  F)r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r   r  r[  r  r   r  r  r  r  r  rM   r   c                \   t          | t          |||          ||||          }|t          j                    }|j        j        r|S |dk    r|                                }|j                            |j	                  dk    s|s|
                    |j	        ||           |                    ||           |                    ||          }|                    |||          \  }}|
r|	nd}	|                    ||||	           t          |j        ||d	 |                                D             |	
          }|                    |||j                  }|                    ||||
||||||
  
         |                    |           |                    ||j	                   |S )Nr.   r5   r6   rQ   r?   r2   rM   r3   rA   rQ   r  r  r<   rr   rQ   normr  c                 "    i | ]\  }}|d v 	||S )r   r2   fcrg  r]   r_   s      rY   rc   zboxplot.<locals>.<dictcomp>]  )    SSS$!QA1R,R,RA,R,R,RrZ   r  
r   r  r  r  r[  r2   r  r   r  r   r=   )r,   ri   pltgcarF   r   r   rJ   rL   r?   scale_categorical_attachr{   rx   map_huer   r  rj   r   r   r  _add_axis_labelsr   )r5   r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r   r  r[  r  r   r  r  r  r  r  rM   r   r   ps                             rY   r%   r%   5  s    	aS)))	 	 	A 
zWYY{ 	!!{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGY#*JIIgYX*IUUU
eSS&,,..SSS  E
 ##IuajAAILL     rr)))IrZ   a      Draw a box plot to show distributions with respect to categories.

    A box plot (or box-and-whisker plot) shows the distribution of quantitative
    data in a way that facilitates comparisons between variables or across
    levels of a categorical variable. The box shows the quartiles of the
    dataset while the whiskers extend to show the rest of the distribution,
    except for points that are determined to be "outliers" using a method
    that is a function of the inter-quartile range.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {fill}
    {dodge}
    {width}
    {gap}
    whis : float or pair of floats
        Paramater that controls whisker length. If scalar, whiskers are drawn
        to the farthest datapoint within *whis * IQR* from the nearest hinge.
        If a tuple, it is interpreted as percentiles that whiskers represent.
    {linecolor}
    {linewidth}
    fliersize : float
        Size of the markers used to indicate outlier observations.
    {hue_norm}
    {log_scale}
    {native_scale}
    {formatter}
    {legend}
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed through to
        :meth:`matplotlib.axes.Axes.boxplot`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {violinplot}
    {stripplot}
    {swarmplot}
    {catplot}

    Examples
    --------
    .. include:: ../docstrings/boxplot.rst

    rS  r   d   scottr<   r   )!r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r'  r   r  r  r   r  cutgridsizer   	bw_adjustr   r   r  r  r  r  rM   r   r   r   r)  r   c       !            t          | t          |||          ||||          }#|!t          j                    }!|#j        j        r|!S |dk    r|#                                }|#j                            |#j	                  dk    s|s|#
                    |#j	        ||           |#                    |!|           |#                    ||          }|#                    |||          \  }}|
r|	nd}	|#                    ||||	           t          |!j        ||d	 |"                                D             |	
          }|#                    |||#j                  }|#                    ||||          \  }}|#                    ||          }t          ||||          }$| i n|                                 } |#                    ||||||
||||||$| |"           |#                    |!           |#                    |!|#j	                   |!S )Nr.   r  r3   rA   r  r  r<   r  c                 "    i | ]\  }}|d v 	||S r  r]   r_   s      rY   rc   zviolinplot.<locals>.<dictcomp>  r  rZ   r  )r  r  r   r  r   r  r  r'  r2   r  r  r   r  r   r   r(  r)  r   r=   )r,   ri   r  r  rF   r   r   rJ   rL   r?   r  r  r{   rx   r  r   r  rj   r   r   r   r   r  rL  r  r   )%r5   r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r'  r   r  r  r   r  r  r  r   r  r   r   r  r  r  r  rM   r   r   r   r)  r   r   r  r(  s%                                        rY   r&   r&     sZ    	aS)))	 	 	A 
zWYY{ 	!!{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGY#*JIIgYX*IUUU
eSS&,,..SSS  E
 ##IuajAAI ! : :y,! !L+ ''I66IsXiXXXG'Y^^-=-=INN!    " rr)))IrZ   a,      Draw a patch representing a KDE and add observations or box plot statistics.

    A violin plot plays a similar role as a box-and-whisker plot. It shows the
    distribution of data points after grouping by one (or more) variables.
    Unlike a box plot, each violin is drawn using a kernel density estimate
    of the underlying distribution.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {fill}
    inner : {{"box", "quart", "point", "stick", None}}
        Representation of the data in the violin interior. One of the following:

        - `"box"`: draw a miniature box-and-whisker plot
        - `"quart"`: show the quartiles of the data
        - `"point"` or `"stick"`: show each observation
    split : bool
        Show an un-mirrored distribution, alternating sides when using `hue`.

        .. versionchanged:: v0.13.0
            Previously, this option required a `hue` variable with exactly two levels.
    {width}
    {dodge}
    {gap}
    {linewidth}
    {linecolor}
    cut : float
        Distance, in units of bandwidth, to extend the density past extreme
        datapoints. Set to 0 to limit the violin within the data range.
    gridsize : int
        Number of points in the discrete grid used to evaluate the KDE.
    bw_method : {{"scott", "silverman", float}}
        Either the name of a reference rule or the scale factor to use when
        computing the kernel bandwidth. The actual kernel size will be
        determined by multiplying the scale factor by the standard deviation of
        the data within each group.

        .. versionadded:: v0.13.0
    bw_adjust: float
        Factor that scales the bandwidth to use more or less smoothing.

        .. versionadded:: v0.13.0
    density_norm : {{"area", "count", "width"}}
        Method that normalizes each density to determine the violin's width.
        If `area`, each violin will have the same area. If `count`, the width
        will be proportional to the number of observations. If `width`, each
        violin will have the same width.

        .. versionadded:: v0.13.0
    common_norm : bool
        When `True`, normalize the density across all violins.

        .. versionadded:: v0.13.0
    {hue_norm}
    {formatter}
    {log_scale}
    {native_scale}
    {legend}
    scale : {{"area", "count", "width"}}
        .. deprecated:: v0.13.0
            See `density_norm`.
    scale_hue : bool
        .. deprecated:: v0.13.0
            See `common_norm`.
    bw : {{'scott', 'silverman', float}}
        .. deprecated:: v0.13.0
            See `bw_method` and `bw_adjust`.
    inner_kws : dict of key, value mappings
        Keyword arguments for the "inner" plot, passed to one of:

        - :class:`matplotlib.collections.LineCollection` (with `inner="stick"`)
        - :meth:`matplotlib.axes.Axes.scatter` (with `inner="point"`)
        - :meth:`matplotlib.axes.Axes.plot` (with `inner="quart"` or `inner="box"`)

        Additionally, with `inner="box"`, the keywords `box_width`, `whis_width`,
        and `marker` receive special handling for the components of the "box" plot.

        .. versionadded:: v0.13.0
    {ax_in}
    kwargs : key, value mappings
        Keyword arguments for the violin patches, passsed through to
        :meth:`matplotlib.axes.Axes.fill_between`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {boxplot}
    {stripplot}
    {swarmplot}
    {catplot}

    Examples
    --------
    .. include:: ../docstrings/violinplot.rst

    r  tukeyy&1|?皙?)r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r   r  r   r  r   r  r  r  r  r  r  r  r  rM   r   r  r  r  r   c                \   t          | t          |||          ||||          } |t          j                    }| j        j        r|S |dk    r|                                 }| j                            | j	                  dk    s|s| 
                    | j	        ||           |                     ||           |                     ||          }|                     |||          \  }}|                     ||          }|
r|	nd}	|                     ||||	           t!          |j        ||i |		          }|                     ||| j                  }|                     ||||
||||||||||||
           |                     |           |                     || j	                   |S )Nr.   r  r3   rA   r  r  r<   r  r  r   r  r  r  r2   r  r   r   r  r  r  r  r  r  r  r   r=   )r,   ri   r  r  rF   r   r   rJ   rL   r?   r  r  r{   rx   r   r  r   r  r   r   r  r  r   )!r5   r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r   r  r   r  r   r  r  r  r  r  r  r  r  rM   r   r  r  r  r   r   r  s!                                    rY   r'   r'   p  s    	aS)))	 	 	A 
zWYY{ 	!!{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGY ,,ULAAL#*JIIgYX*IUUU
e
	  E ##IuajAAIMM!!!    & rr)))IrZ   an      Draw an enhanced box plot for larger datasets.

    This style of plot was originally named a "letter value" plot because it
    shows a large number of quantiles that are defined as "letter values".  It
    is similar to a box plot in plotting a nonparametric representation of a
    distribution in which all features correspond to actual observations. By
    plotting more quantiles, it provides more information about the shape of
    the distribution, particularly in the tails.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {fill}
    {dodge}
    {width}
    {gap}
    {linewidth}
    {linecolor}
    width_method : {{"exponential", "linear", "area"}}
        Method to use for the width of the letter value boxes:

        - `"exponential"`: Represent the corresponding percentile
        - `"linear"`: Decrease by a constant amount for each box
        - `"area"`: Represent the density of data points in that box
    k_depth : {{"tukey", "proportion", "trustworthy", "full"}} or int
        The number of levels to compute and draw in each tail:

        - `"tukey"`: Use log2(n) - 3 levels, covering similar range as boxplot whiskers
        - `"proportion"`: Leave approximately `outlier_prop` fliers
        - `"trusthworthy"`: Extend to level with confidence of at least `trust_alpha`
        - `"full"`: Use log2(n) + 1 levels and extend to most extreme points
    outlier_prop : float
        Proportion of data expected to be outliers; used when `k_depth="proportion"`.
    trust_alpha : float
        Confidence threshold for most extreme level; used when `k_depth="trustworthy"`.
    showfliers : bool
        If False, suppress the plotting of outliers.
    {hue_norm}
    {log_scale}
    {native_scale}
    {formatter}
    {legend}
    box_kws: dict
        Keyword arguments for the box artists; passed to
        :class:`matplotlib.patches.Rectangle`.

        .. versionadded:: v0.12.0
    line_kws: dict
        Keyword arguments for the line denoting the median; passed to
        :meth:`matplotlib.axes.Axes.plot`.

        .. versionadded:: v0.12.0
    flier_kws: dict
        Keyword arguments for the scatter denoting the outlier observations;
        passed to :meth:`matplotlib.axes.Axes.scatter`.

        .. versionadded:: v0.12.0
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed to :class:`matplotlib.patches.Rectangle`,
        superceded by those in `box_kws`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {violinplot}
    {boxplot}
    {catplot}

    Notes
    -----

    For a more extensive explanation, you can read the paper that introduced the plot:
    https://vita.had.co.nz/papers/letter-value-plot.html

    Examples
    --------
    .. include:: ../docstrings/boxenplot.rst

    r  )r/   r0   r1   rQ   rs   r&  r  r?   r2   rr   r   r  r   r  r  r  r  rM   r   c                `   t          | t          |||          |||	|          }|t          j                    }|j        j        r|S |j                            |j                  dk    s|s|	                    |j        ||           |
                    ||           |                    |
|          }|                    |	|
|          \  }
}|                    |
||           t          |j        ||	|          }	|                    ||	|j                  }|                    dd           |                    d	|          }|                    |d
z  ||           |                    |||	|           |                    |           |                    ||j                   |S )Nr.   r  rA   r  r  rr   rQ   r  r  rd   r  r   r  r  r   r&  r  r2   r   r=   )r,   ri   r  r  rF   r   rJ   rL   r?   r  r  r{   rx   r  r   r$  r   r   r}  r   r0  r  r   )r5   r/   r0   r1   rQ   rs   r&  r  r?   r2   rr   r   r  r   r  r  r  r  rM   r   r   r  s                         rY   r#   r#     s    	aS)))	 	 	A 
zWYY{ 	{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGYIIgYXI>>>2:sE6::E##IuajAAI
h"""::c4  D
MM
!)     MM	     rr)))IrZ   a      Draw a categorical scatterplot using jitter to reduce overplotting.

    A strip plot can be drawn on its own, but it is also a good complement
    to a box or violin plot in cases where you want to show all observations
    along with some representation of the underlying distribution.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    jitter : float, `True`/`1` is special-cased
        Amount of jitter (only along the categorical axis) to apply. This
        can be useful when you have many points and they overlap, so that
        it is easier to see the distribution. You can specify the amount
        of jitter (half the width of the uniform random variable support),
        or use `True` for a good default.
    dodge : bool
        When a `hue` variable is assigned, setting this to `True` will
        separate the strips for different hue levels along the categorical
        axis and narrow the amount of space allotedto each strip. Otherwise,
        the points for each level will be plotted in the same strip.
    {orient}
    {color}
    {palette}
    size : float
        Radius of the markers, in points.
    edgecolor : matplotlib color, "gray" is special-cased
        Color of the lines around each point. If you pass `"gray"`, the
        brightness is determined by the color palette used for the body
        of the points. Note that `stripplot` has `linewidth=0` by default,
        so edge colors are only visible with nonzero line width.
    {linewidth}
    {hue_norm}
    {log_scale}
    {native_scale}
    {formatter}
    {legend}
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed through to
        :meth:`matplotlib.axes.Axes.scatter`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {swarmplot}
    {boxplot}
    {violinplot}
    {catplot}

    Examples
    --------
    .. include:: ../docstrings/stripplot.rst

    )r/   r0   r1   rQ   rs   r  r?   r2   rr   r   r  r   r  r  r  r  rM   r2  r   c                   t          | t          |||          ||||          }|t          j                    }|j        j        r|S |j                            |j                  dk    s|s|	                    |j        ||           |
                    ||           |j        s|S |                    |	|          }|                    ||	|          \  }	}|                    |	||           t          |j        |||          }|                    |||j                  }|                    dd           |                    d	|
          }
||
d
z  }|                    t          |
dz  ||                     |                    ||||           |                    |           |                    ||j                   |S )Nr.   r  rA   r  r  r  r  rd   r  
   r   r  r  r2   r2  r   r=   )r,   ri   r  r  rF   r   rJ   rL   r?   r  r  rN   r{   rx   r  r   r$  r   r   r}  r   rI  r  r   )r5   r/   r0   r1   rQ   rs   r  r?   r2   rr   r   r  r   r  r  r  r  rM   r2  r   r   r  s                         rY   r$   r$     s    	aS)))	 	 	A 
zWYY{ 	{qx  M111	AHEYGGGIIbII&&&= 	 11'9EEI**5'9EEGYIIgYXI>>>2:sE6::E##IuajAAI
h"""::c4  D2I	
MM$
!)      MM	     rr)))IrZ   a      Draw a categorical scatterplot with points adjusted to be non-overlapping.

    This function is similar to :func:`stripplot`, but the points are adjusted
    (only along the categorical axis) so that they don't overlap. This gives a
    better representation of the distribution of values, but it does not scale
    well to large numbers of observations. This style of plot is sometimes
    called a "beeswarm".

    A swarm plot can be drawn on its own, but it is also a good complement
    to a box or violin plot in cases where you want to show all observations
    along with some representation of the underlying distribution.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    dodge : bool
        When a `hue` variable is assigned, setting this to `True` will
        separate the swarms for different hue levels along the categorical
        axis and narrow the amount of space allotedto each strip. Otherwise,
        the points for each level will be plotted in the same swarm.
    {orient}
    {color}
    {palette}
    size : float
        Radius of the markers, in points.
    edgecolor : matplotlib color, "gray" is special-cased
        Color of the lines around each point. If you pass `"gray"`, the
        brightness is determined by the color palette used for the body
        of the points.
    {linewidth}
    {log_scale}
    {native_scale}
    {formatter}
    {legend}
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed through to
        :meth:`matplotlib.axes.Axes.scatter`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {boxplot}
    {violinplot}
    {stripplot}
    {catplot}

    Examples
    --------
    .. include:: ../docstrings/swarmplot.rst

    r  )r  _   i  )r/   r0   r1   rQ   rs   r  errorbarn_bootseedunitsr  r?   r2   rr   r  r  r  r   r  r  r  r  r  rM   r   r   r  r   r   r   c                   t          j        ||          }|t          u rd}t          | t	          ||||
|          ||||          } |t          j                    }| j        j        r|S |dk    r| 	                                }| j
                            | j                  dk    s|s|                     | j        ||           |                     ||           |                     ||          }|                     |||          \  }}|r|nd}|                     ||||	           t%          |j        ||||
          }d| j        v rt(          nt*          }! |!||||	          }"|i nt-          |t.          j        j                  }|                     ||||          \  }}|                     |"||||||||	  	         |                     |           |                     || j                   |S )Nr   r/   r0   r1   r  r  r  r3   rA   r  r  r<   r  r  r  r  r  	r]  r  r   r  r2   r  r   r   r   r=   )r   _deprecate_cir   r  ri   r  r  rF   r   r   rJ   rL   r?   r  r  r{   rx   r  r   rq  r   r   r   rl   r{  r|  r   ru  r  r   )#r5   r/   r0   r1   rQ   rs   r  r  r  r  r  r  r?   r2   rr   r  r  r  r   r  r  r  r  r  rM   r   r   r  r   r   r   r   r  agg_clsr]  s#                                      rY   r)   r)   	  s>    "8R00H C	aSgFFF	 	 	A 
zWYY{ 	!!{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGY#*JIIgYX*IUUU263v*MMME$,$;$;  ASGHV$GGGJObb)9'39CS)T)TG ,,Wh'RRGWKK  
 
 
 rr)))IrZ   aS      Show point estimates and errors as rectangular bars.

    A bar plot represents an aggregate or statistical estimate for a numeric
    variable with the height of each rectangle and indicates the uncertainty
    around that estimate using an error bar. Bar plots include 0 in the
    axis range, and they are a good choice when 0 is a meaningful value
    for the variable to take.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    {stat_api_params}
    {orient}
    {color}
    {palette}
    {saturation}
    {fill}
    {hue_norm}
    {width}
    {dodge}
    {gap}
    {log_scale}
    {native_scale}
    {formatter}
    {legend}
    {capsize}
    {err_kws}
    {ci}
    {errcolor}
    {errwidth}
    {ax_in}
    kwargs : key, value mappings
        Other parameters are passed through to :class:`matplotlib.patches.Rectangle`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {countplot}
    {pointplot}
    {catplot}

    Notes
    -----

    For datasets where 0 is not a meaningful value, a :func:`pointplot` will
    allow you to focus on differences between levels of one or more categorical
    variables.

    It is also important to keep in mind that a bar plot shows only the mean (or
    other aggregate) value, but it is often more informative to show the
    distribution of values at each level of the categorical variables. In those
    cases, approaches such as a :func:`boxplot` or :func:`violinplot` may be
    more appropriate.

    Examples
    --------
    .. include:: ../docstrings/barplot.rst

    )r/   r0   r1   rQ   rs   r  r  r  r  r  r  r2   rr   r  r^  r_  r  r  r  r?   r   r  rM   r   r  r   r   r   r   c          
         t          j        ||          }t          | t          ||||
|          ||||dn||          }|t	          j                    }|j        j        r|S |j        	                    |j
                  dk    s|s|                    |j
        ||           |                    ||           |                    ||          }|                    |||          \  }}|                    |||           t!          |j        |||          }d|j        v rt$          nt&          }  | ||||		          }!|i nt)          |t*          j        j                  }|                    |||           |                    |d ||          \  }}|                    |!|||||||
           |                    |           |                    ||j
                   |S )Nr  C0r  rA   r  r  r  r  r  r]  r^  r_  r  r2   r   r   r   r=   )r   r  r  ri   r  r  rF   r   rJ   rL   r?   r  r  r{   rx   r  r   r  r   r   r   rl   r{  r|  r   r   rl  r  r   )"r5   r/   r0   r1   rQ   rs   r  r  r  r  r  r  r2   rr   r  r^  r_  r  r  r  r?   r   r  rM   r   r  r   r   r   r   r   r  r  r]  s"                                     rY   r(   r(   	  s"    "8R00HaSgFFF }ddu		 		 		A 
zWYY{ 	{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGYIIgYXI>>>27C77E$,$;$;  ASGHV$GGGJObb)9'39CS)T)TG udF333,,WdHgNNGWMM  	 	 	 rr)))IrZ   a	      Show point estimates and errors using lines with markers.

    A point plot represents an estimate of central tendency for a numeric
    variable by the position of the dot and provides some indication of the
    uncertainty around that estimate using error bars.

    Point plots can be more useful than bar plots for focusing comparisons
    between different levels of one or more categorical variables. They are
    particularly adept at showing interactions: how the relationship between
    levels of one categorical variable changes across levels of a second
    categorical variable. The lines that join each point from the same `hue`
    level allow interactions to be judged by differences in slope, which is
    easier for the eyes than comparing the heights of several groups of points
    or bars.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    {stat_api_params}
    {color}
    {palette}
    markers : string or list of strings
        Markers to use for each of the `hue` levels.
    linestyles : string or list of strings
        Line styles to use for each of the `hue` levels.
    dodge : bool or float
        Amount to separate the points for each level of the `hue` variable along
        the categorical axis. Setting to `True` will apply a small default.
    {log_scale}
    {native_scale}
    {orient}
    {capsize}
    {formatter}
    {legend}
    {err_kws}
    {ci}
    {errwidth}
    join : bool
        If `True`, connect point estimates with a line.

        .. deprecated:: v0.13.0
            Set `linestyle="none"` to remove the lines between the points.
    scale : float
        Scale factor for the plot elements.

        .. deprecated:: v0.13.0
            Control element sizes with :class:`matplotlib.lines.Line2D` parameters.
    {ax_in}
    kwargs : key, value mappings
        Other parameters are passed through to :class:`matplotlib.lines.Line2D`.

        .. versionadded:: v0.13.0

    Returns
    -------
    {ax_out}

    See Also
    --------
    {barplot}
    {catplot}

    Notes
    -----
    It is important to keep in mind that a point plot shows only the mean (or
    other estimator) value, but in many cases it may be more informative to
    show the distribution of values at each level of the categorical variables.
    In that case, other approaches such as a box or violin plot may be more
    appropriate.

    Examples
    --------
    .. include:: ../docstrings/pointplot.rst

    r  )r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r  r   r  r  r  r  r  rM   r   c                   ||d}t          |          rdnd }n-||d}t          |          rdnd }n||t          d          t          | t          |||          ||||          }|t	          j                    }|j        j        r|S |dk    r|                                }|j	        
                    |j                  dk    s|s|                    |j        ||	           |                    ||
           |                    ||          }|                    |||          \  }}|
r|	nd}	|                    ||||	           t#          |j        ||||	          }ddd|j                 }|j        dk    r
d|j        |<   t)          dg d|           ||j        |<   |dk    r4|dk    rdnd}|j        |xx         t-          |j                  |z  z  cc<   t/          dd           }|                    ||||||
di |	  	         |                    |           |                    ||j                   |S )Nr0   r<   r/   (Cannot pass values for both `x` and `y`.r.   r  r3   rA   r  r  r  r9   r7   r  r  percentprobability
proportionr  r  r  sumr  r   r  r=   )r   	TypeErrorr  ri   r  r  rF   r   r   rJ   rL   r?   r  r  r{   rx   r  r   rq  rE   r   r6   r   r   ru  r  r   )r5   r/   r0   r1   rQ   rs   r?   r2   rr   r  r  r  r  r   r  r  r  r  r  rM   r   r   r  
count_axisdenomr]  s                             rY   r*   r*   7
  s    	yQ]a"AAd	
19a"AAd	
1=BCCCaS)))	 	 	A 
zWYY{ 	!!{qx  M111	AHEYGGGIIbII&&& 11'9EEI**5'9EEGY#*JIIgYX*IUUU263vzBBE%%ah/J~"#JFMMMtTTT"AK
wy((a	J3q{#3#3e#;;#ED999JKK  
 
 
 rr)))IrZ   ao      Show the counts of observations in each categorical bin using bars.

    A count plot can be thought of as a histogram across a categorical, instead
    of quantitative, variable. The basic API and options are identical to those
    for :func:`barplot`, so you can compare counts across nested variables.

    Note that :func:`histplot` function offers similar functionality with additional
    features (e.g. bar stacking), although its default behavior is somewhat different.

    {categorical_narrative}

    Parameters
    ----------
    {categorical_data}
    {input_params}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {hue_norm}
    stat : {{'count', 'percent', 'proportion', 'probability'}}
        Statistic to compute; when not `'count'`, bar heights will be normalized so that
        they sum to 100 (for `'percent'`) or 1 (otherwise) across the plot.

        .. versionadded:: v0.13.0
    {width}
    {dodge}
    {log_scale}
    {native_scale}
    {formatter}
    {legend}
    {ax_in}
    kwargs : key, value mappings
        Other parameters are passed through to :class:`matplotlib.patches.Rectangle`.

    Returns
    -------
    {ax_out}

    See Also
    --------
    histplot : Bin and count observations with additional options.
    {barplot}
    {catplot}

    Examples
    --------
    .. include:: ../docstrings/countplot.rst

    strip)!r/   r0   r1   r   r   kindr  r  r  r  r  r  rQ   rs   	row_order	col_ordercol_wrapro  aspectr  r  r  r?   r2   rr   r  rM   
legend_outsharexshareymargin_titles	facet_kwsr  c       !            d|"v r5d| d}#t          j        |#t                     |"                    d           g d}$g d}%|dv rt          }&nt
          }&|dk    r%||d}d	}n||d
}d	}n||t          d           |&| t          |||||||          |||dk    r||dn||          }'dD ]&}(|(|'j        v r|'j        |(         d|( d|'j        |(<   '|'j	        
                    |'j                  })|)j        d d |)j                                         f         })|'j                            dd           }*|'j                            dd           }+| i } t          dy|)|+|*|||||||||d| },|'j        }-|r|'j        |'j                 dk    r|'                    |'j        ||           |'                    |,|           |-s|,S |'                    ||          }|'                    |||          \  }}t/          j        ||!          }|"                    d||$v r|"                    dd          rdnd	          }.|'                    ||||.           ||dn|}|.d	k     rt5          ||.          }|dv rWt7          |"t8          j        j                  }"|'                    |"                    dt@                    ||'j!                  |"d<   |"                    d d!          }/|"                    d"||%v rd#nd$          }0|0d$k    r|'"                                }0d%|'j	        v r(|d&vrd'|d(}#t          j        |#d)*           tF          }1ntH          }1|d+k    r|"                    d,d          }2|"%                                }3|3&                    d-d.           |3&                    d/d0           d1|3vr|3                    d2d3          d)z  |3d1<   |''                    |2|0||34           nL|d5k    r|"                    d6d7          }4|"%                                }3|3&                    d-d.           d1|3vr|3                    d2d3          d)z  |3d1<   |3&                    d/d0           tQ          j)        |3d1                   d8z  |3d/<   |'*                    |0||4|39           n|d:k    r|"%                                }3|3                    d;d0          }5|3                    dd          }6|3                    d<d=          }7|3                    d/d           }8|3                    d>d3          }9|'                    |3                    d?d$          ||'j!                  }:|'+                    |/|0|5|6|7||:|8|9|3@
  
         n|dAk    r|"%                                }3|3                    d;d0          }5|3                    dd          }6|3                    dBd#          };|3                    dCd:          }<|3                    dDdE          }=|3                    dFd#          }>|3                    dGtX                    }?|3                    dHtX                    }@|'-                    |?|@|=|>          \  }=}>|'.                    |3                    dItX                    |3                    dJdK                    }At          |3                    dLd)          |3                    dMdN          |3                    dOd	          |AP          }B|3                    dQi           %                                }C|3                    d/d           }8|3                    d?d$          }:|'                    |:||'j!                  }:|'/                    |/|0|5|;||6|:|8|<|=|>|B|C|3R           n|dSk    r|"%                                }3|3                    d;d0          }5|3                    dd          }6|3                    d?d$          }:|3                    d/d           }8|3                    dTdU          }D|3                    dVdW          }E|3                    dXdY          }F|3                    dZd7          }G|3                    d[d          }H|3                    d\i           }I|3                    d]i           }J|3                    d^i           }KdG|3v r|'0                    |3dG         |E          }E|'                    |:||'j!                  }:|'1                    |/|0|5|6||:|8|E|D|F|G|H|I|J|K|3_           n|dk    r' |1|||	|
`          }L|"                    dat@                    }M|"                    dbt@                    }N|'2                    |"                    dGtX                    |"                    dctX                    |"           |'3                    t7          |"                    ddi           t8          j4        j5                  d |"                    detX                    |"                    dfd0          g          \  }O}P|'6                    |L|M|N|0||P|O|"h           n|dik    r |1|||	|
`          }L|'3                    t7          |"                    ddi           t8          j4        j5                  |"                    djtX                    |"                    detX                    |"                    dfd0          k          \  }O}P|"                    d;d0          }5|"                    dd          }6|'7                    |L|0|/|5||6|P|O|"l	  	         n|dk    rtI          dmd n          }Ldd
do|'j                 }Qd	|'j	        |Q<   g dp}Rtq          dq|R|"                    dqd                    }S|S|'j        |Q<   |Sdk    r4|Sdrk    rdNnd	}T|'j	        |Qxx         ts          |'j	                  |Tz  z  cc<   |"                    d;d0          }5|"                    dd          }6|'7                    |L|0|/|5||6d0i |"l	  	         nds|dt}#t          |#          |,j:        j;        D ]}U|'<                    |U|'j        u           |,=                    |'j                            d
          |'j                            d                     |,>                                 |,?                                 |,j:        j;        D ]}U|,@                    |U           d |U_A        |d$k    r|'jB         o
|'jC        dvk    }Vnt          |          }V|Vr/|,E                    |'j                            dw          |x           | | |,_F        |,S )zNr   zXcatplot is a figure-level function and does not accept target axes. You may wish to try r  )rq  r  rS  r  r  )r  swarmr  )rq  r  r  r  r0   r<   r/   r  )r/   r0   r1   r   r   r  r  r  r  r  )r   r   r   r:   r   r   )r5   r   r   r  r  r  r  r  r  r  ro  r  rA   r  r  r  r  Tr   r  )r  r  r  r   r  r  Fr3   r  )rq  r  z0The `weights` parameter has no effect with kind=.r   re   r  r&  r  rd   r   r   r  r   r  r  r  r2  r  r  r  rS  r  r[  rn  r  r  r  r  r'  r  r   r   r   r   r   r   r   r  r  r  r  r  )r  r  r  r   r)  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r^  r_  r   r   r   r   )r   r   r  rq  r   )r   r   r   r  r  r  r9   r  r  r  zInvalid `kind`: zV. Options are 'strip', 'swarm', 'box', 'boxen', 'violin', 'bar', 'count', and 'point'.r=   r7   r1   )r   label_orderr]   )Gro   rp   UserWarningrI   r  r,   
ValueErrorri   r6   rF   rG   locr;   
duplicatedrL   r    rN   rJ   r?   r  r  r{   rx   r   r  r  r   r   rl   r!  PathCollectionr   r   r   r   r   r   r  r}  r0  r   rR  rI  r  r   r   r   rL  r   r  r   r   r{  r|  rl  ru  r   r   axesflatr   set_axis_labels
set_titlestight_layout_update_legend_datalegend_rg   rE   r   
add_legendr5   )Wr5   r/   r0   r1   r   r   r  r  r  r  r  r  r  rQ   rs   r  r  r  ro  r  r  r  r  r?   r2   rr   r  rM   r  r  r  r  r  r  r   rw   desaturated_kindsundodged_kindsPlotterr  r   
facet_datacol_namerow_namegrN   r  r   r  r  r&  r   r2  r  r  r[  r   r  r  r'  r  r   r   r   r   r   r(  r)  r  r   r  r  r  r  r  r  r]  r^  r_  r   r   r  stat_optionsr  r  r   r   sW                                                                                          rY   r"   r"   
  s    v~~>37> > >c;'''

4BBB000N((((%w9FAA]qyFAA]q}GHHH1#3CuW
 
 
  goo'/emddQV	 	 	A  * *!+!+c"2":)3zzzAK ##AK#88JJ$6$A$A$C$C#C CDJ{ud++H{ud++H	 	X8hy]f		 	
 	 	A -K H1;qx0MAA	AHEYGGGIIa9I%%%  11'9EEI**5'9EEGY "8R00H)))fjj.F.F)A J IIgYX*IUUU {5>>uj11E!!!!&#/*HII11JJ{G,,eQZ
 
{ JJw$$EJJw)?)?VLLE!!1;'''NTNNNCM#!,,,,$$wHd++;;==Ha(((K+++h$LL33q8HSM		 	 	
 	
 	
 	
 
jj44;;==Ha(((h$LL33q8HSM{A..6$&GHSM$:$:R$?H[!	#	 	 	
 	
 	
 	
 
;;==ll5!$$||FD))||FC((LLd33	LLa00	''LLf--uaj
 
	 	
 	 	
 	
 	
 	
 
		;;==ll5!$$||FD))We,,We,,||NF;;ll=%88Wj11LLj99	$%$>$>9lK%
 %
!k ++LLz**HLLg,N,N
 
	 UA&&\\*c22ll;22	
 
 
 LLb116688	LLd33	LLf55	''	5!*EE		%# 	 	
 	
 	
 	
" 
;;==ll5!$$||FD))LLf55	LLd33	,,y'22||NMBB||NE::ll=$77\\,55
,,y"--LLb11	<<
B//h44!< L ''	5!*EE		%%#!! 	 	
 	
 	
 	
& 
WYdKKK
**Y00ZZg66
 	
""JJw
++JJvz**	
 	
 	

 00VZZ	266	8HIIZZ
J77JJy!,,	 1 
 
 	
!! 	 		
 		
 		
 		
 
WYdKKK
00VZZ	266	8HIIZZ
J77ZZ
J77JJy!,,	 1 
 
 jj""zz&$''	! 	 
	
 
	
 
	
 
	
 
'===
S))!(3
"#JHHHv|VZZ5P5PQQ"&J7??9,,CC!EK
###s1;'7'7%'??###jj""zz&$''	! 	 
	
 
	
 
	
 
	
Et E E E 	 oofk . .	2AH----akooc**AKOOC,@,@AAALLNNNNNfk  	b!!!

**Gq~/G6ll J	1;??511yIIIHrZ   a	      Figure-level interface for drawing categorical plots onto a FacetGrid.

    This function provides access to several axes-level functions that
    show the relationship between a numerical and one or more categorical
    variables using one of several visual representations. The `kind`
    parameter selects the underlying axes-level function to use.

    Categorical scatterplots:

    - :func:`stripplot` (with `kind="strip"`; the default)
    - :func:`swarmplot` (with `kind="swarm"`)

    Categorical distribution plots:

    - :func:`boxplot` (with `kind="box"`)
    - :func:`violinplot` (with `kind="violin"`)
    - :func:`boxenplot` (with `kind="boxen"`)

    Categorical estimate plots:

    - :func:`pointplot` (with `kind="point"`)
    - :func:`barplot` (with `kind="bar"`)
    - :func:`countplot` (with `kind="count"`)

    Extra keyword arguments are passed to the underlying function, so you
    should refer to the documentation for each to see kind-specific options.

    {categorical_narrative}

    After plotting, the :class:`FacetGrid` with the plot is returned and can
    be used directly to tweak supporting plot details or add other layers.

    Parameters
    ----------
    {categorical_data}
    {input_params}
    row, col : names of variables in `data` or vector data
        Categorical variables that will determine the faceting of the grid.
    kind : str
        The kind of plot to draw, corresponds to the name of a categorical
        axes-level plotting function. Options are: "strip", "swarm", "box", "violin",
        "boxen", "point", "bar", or "count".
    {stat_api_params}
    {order_vars}
    row_order, col_order : lists of strings
        Order to organize the rows and/or columns of the grid in; otherwise the
        orders are inferred from the data objects.
    {col_wrap}
    {height}
    {aspect}
    {native_scale}
    {formatter}
    {orient}
    {color}
    {palette}
    {hue_norm}
    {legend}
    {legend_out}
    {share_xy}
    {margin_titles}
    facet_kws : dict
        Dictionary of other keyword arguments to pass to :class:`FacetGrid`.
    kwargs : key, value pairings
        Other keyword arguments are passed through to the underlying plotting
        function.

    Returns
    -------
    :class:`FacetGrid`
        Returns the :class:`FacetGrid` object with the plot on it for further
        tweaking.

    Examples
    --------
    .. include:: ../docstrings/catplot.rst

    c                   >    e Zd ZdZddZd Zd Zd Zd	 Zd
 Z	d Z
dS )rC  z6Modifies a scatterplot artist to show a beeswarm plot.r/   r  r  c                 0    || _         || _        || _        d S r  )r?   r   r2  )rP   r?   r   r2  s       rY   rD   zBeeswarm.__init__  s    
&rZ   c                    |j         }|j        j        }|                                }| j        dk    rdnd}||dd|f<   |j        \  }}|j                            |          }	| j        dk    r|	ddddgf         }	|                                }
|
j	        dk    r t          j        |
|	j        d                   }
|                                                                }t          j        |
          |z   dz  |dz  z  }t          j        |	|f         }	t          j        |	dddf                   }|	|         }t          j        |          }|                     |          ||<   | j        dk    r|ddddgf         }n|ddddf         }|j                                                            |          j        \  }}t+          || j                  \  }}| j        dk    r|                     ||||           n|                     ||||           | j        dk    r)|                    t          j        ||f                    dS |                    t          j        ||f                    dS )z?Swarm `points`, a PathCollection, around the `center` position.r0   r<   r   Nr   r  )r  rG  dpirD  r?   r  r<  r  	get_sizesr   r   repeatrE  get_linewidthr  rR  c_argsort
empty_likerA  invertedr   add_guttersset_offsets)rP   r/  r3  r   r  orig_xy_datacat_idxorig_x_dataorig_y_dataorig_xysizesr   radiisorterorig_xyrnew_xyrnew_xy
new_x_data
new_y_datat_fwdt_invs                        rY   __call__zBeeswarm.__call__  s    [im ))++ {c))!!q#)QQQZ 
 $0> [,((66 ;#aaa!Qi(G   "":??IeW]1%566E##%%**,,$&!+sRx8%' GAAAqDM**6? -))--11 ;#QQQAY'FFQQQU^F!#!6!6!8!8!B!B6!J!J!L
J 0DK@@u;#Z>>>>Z>>> ;#ru[*%<=>>>>>ruZ%<=>>>>>rZ   c                    |d         }t          j        |d                   }|dd         D ]}|                     ||          }|                     ||          }t          j        |dddf         |z
            }|t          j        |                   }|                     ||          }t          j        ||g          }|S )z.Adjust x position of points to avoid overlaps.)r   r   r   r<   N)r   
atleast_2dcould_overlapposition_candidatesabsr  first_non_overlapping_candidatevstack)	rP   r  midliner  xyr_i	neighbors
candidatesr  	new_xyr_is	            rY   rA  zBeeswarm.beeswarm  s     4. hqk** abb\ 	2 	2E **5%88I 11%CCJ fZ1-788G#BJw$7$78J <<ZSSI Iui011EErZ   c                     |\  }}}g }t          |          D ]*}|\  }}}	||z
  ||	z   k     r|                    |           * t          j        |          ddd         S )zAReturn a list of all swarm points that could overlap with target.Nr  )reversedr  r   r  )
rP   r  r  r   y_ir_ir  xyr_jy_jr_js
             rY   r  zBeeswarm.could_overlap  s|     3	e__ 	 	EKAsCc	cCi((  ''''x	""44R4((rZ   c                 $   |g}|\  }}}d}|D ]o\  }}	}
||	z
  }t          j        t          ||
z   dz  |dz  z
  d                    dz  }||z
  ||f||z   ||f}}|r||g}n||g}|                    |           | }pt          j        |          S )z@Return a list of coordinates that might be valid by adjusting x.Tr   r   g?)r   rR  r   extendr  )rP   r  r  r  x_ir"  r#  
left_firstx_jr%  r&  rI  rH  clcrnew_candidatess                   rY   r  zBeeswarm.position_candidates  s    W
S#
& 		( 		(MCcsBcCiA-a7;;<<tCBBhS)C"Hc3+?B *"$b"$bn---'JJx
###rZ   c                    t          |          dk    r|d         S |dddf         }|dddf         }|dddf         }|D ]p}|\  }}}	||z
  }
||z
  }t          j        |
          t          j        |          z   }t          j        ||	z             }t          j        ||k              }|r|c S qt	          d          )z>Find the first candidate that does not overlap with the swarm.r   Nr<   r   z<No non-overlapping candidates found. This should not happen.)r   r   squarerk   RuntimeError)rP   r  r  neighbors_xneighbors_yneighbors_rr  r)  r"  r#  rH  rI  sq_distances
sep_neededgood_candidates                  rY   r  z(Beeswarm.first_non_overlapping_candidate  s     y>>Qa= 1o1o1o 	 	E!MCcs"Bs"B9R==29R==8L;#455J
  VLJ$>??N  J
 
 	
rZ   c                    | j         dz  } | ||          |z
            }||k     }|                                r|||<    | ||          |z             }||k    }	|	                                r|||	<   |	|z                                   t          |          z  }
|
| j        k    r/d                    |
          }t          j        |t                     |S )z2Stop points from extending beyond their territory.r   zi{:.1%} of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.)	r   r"  r  r   r2  formatro   rp   r  )rP   r/  r3  	trans_fwd	trans_inv
half_width
low_gutteroff_lowhigh_gutteroff_highgutter_proprw   s               rY   r  zBeeswarm.add_gutters5  s    Z!^
Yyy00:=>>
:%;;== 	)(F7Oi		& 1 1J >??K'<<>> 	+*F8')..003v;;>)))Hf[!!  M#{+++rZ   N)r/   r  r  )r|  r}  r~  __doc__rD   r  rA  r  r  r  r  r]   rZ   rY   rC  rC    s        @@' ' ' ':? :? :?x  @) ) )$ $ $"
 
 
B    rZ   rC  BoxPlotArtistsz$box median whiskers caps fliers meanc                   >    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	S )
r  c                    |d         | _         |d         | _        |d         | _        |d         | _        |d         | _        |d         | _        d | _        g | j         | j        | j        | j        | j        | j        | _        d S )Nru  ry  whiskersrz  rd  means)ru  ry  rF  rz  rd  rG  _label	_children)rP   artist_dicts     rY   rD   zBoxPlotContainer.__init__Q  s     )
"9-#J/'	!(+ )

Z
\
 ]
 Y	

 [
 Z
rZ   c                 2    dt          | j                   dS )Nz<BoxPlotContainer object with z boxes>)r   ru  rP   s    rY   __repr__zBoxPlotContainer.__repr__d  s    HDJHHHHrZ   c           	      L   t          d|z  d|z  dz             }t          | j        r| j        |         ng | j        r| j        |         ng | j        r| j        |         ng | j        r| j        |         ng | j        r| j        |         ng | j        r| j        |         ng           S )Nr   )slicerC  ru  ry  rF  rz  rd  rG  )rP   idx
pair_slices      rY   __getitem__zBoxPlotContainer.__getitem__g  s    1s7AGaK00
#z1DJsOOr!%5DL2)->DM*%%B%)Y6DIj!!B $3DK"j0DJsOOb
 
 	
rZ   c              #   r    K    fdt          t           j                            D             E d {V  d S )Nc              3   (   K   | ]}|         V  d S r  r]   )r`   r  rP   s     rY   r  z,BoxPlotContainer.__iter__.<locals>.<genexpr>s  s'      <<DG<<<<<<rZ   )r  r   ru  rL  s   `rY   __iter__zBoxPlotContainer.__iter__r  sI      <<<<U3tz??%;%;<<<<<<<<<<<<rZ   c                     | j         S r  rH  rL  s    rY   	get_labelzBoxPlotContainer.get_labelu  s
    {rZ   c                     || _         d S r  rW  )rP   r   s     rY   	set_labelzBoxPlotContainer.set_labelx  s    rZ   c                     | j         S r  )rI  rL  s    rY   get_childrenzBoxPlotContainer.get_children{  s
    ~rZ   c                 B    | j         D ]}|                                 d S r  )rI  remove)rP   childs     rY   r^  zBoxPlotContainer.remove~  s,    ^ 	 	ELLNNNN	 	rZ   N)r|  r}  r~  rD   rM  rR  rU  rX  rZ  r\  r^  r]   rZ   rY   r  r  O  s        
 
 
&I I I	
 	
 	
= = =          rZ   r  r]   r  )Mr!  r   textwrapr   ro   colorsysr   	functoolsr   numpyr   pandasr  
matplotlibrl   matplotlib.cbookr   matplotlib.collectionsr	   matplotlib.markersr
   matplotlib.patchesr   matplotlib.pyplotpyplotr  seaborn._core.typingr   r   seaborn._baser   r   r   seaborn._stats.densityr   seabornr   seaborn.utilsr   r   r   r   r   r   r   r   seaborn._compatr   seaborn._statisticsr   r   r   seaborn.palettesr   seaborn.axisgridr    r!   __all__r,   r  ri   _categorical_docsr   r%   r9  rB  r&   r'   r#   r$   r)   r(   r*   r"   rC  rC  r  r]   rZ   rY   <module>rw     s   " " " " " "                                - - - - - - 2 2 2 2 2 2 * * * * * * ( ( ( ( ( (       4 4 4 4 4 4 4 4 H H H H H H H H H H & & & & & &      	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 9 8 8 8 8 8         
 + * * * * * 3 3 3 3 3 3 3 3  W& W& W& W& W&- W& W& W&t(5 5 5 5 50 5 5 5
 D ` ` ` !& " 	 	 	`   	 	 	`" V  	 	 	#`, v  	 	 	-`6 F  	 	 	7`d v  	 	 	e`r 6 	 		 		 		s`F &  	 	 	G`N F  	 	 	O`Z V  	 	 	[`h v  	 	 	i`t F  	 	 	u`| V  	 	 	}`J V  	 	 	K`X 
  
	 
	 
	Y`d 	  		 		 		e`p &  	 	 	q`z & 	 		 		 		{`N f  	 	 	O`V f  	 	 	W`b f  	 	 	c`t   	 	 	u`B f  	 	 	C`P 6 	 		 		 		Q`d F  	 	 	e`p &  	 	 	q`x 6  	 	 	y`D F  	 	 	E`J v  	 	 	K`P f  	 	 	Q`X f  	 	 	Y`` F  	 	 	a`f f  	 	 	g`l f  	 	 	m`r F  	 	 	s`x f  	 	 	y` D    % % % 
=Dd$$tTc
vTQUd= = = = =@:&& : :	 :	t 
u:% :%t $u:% :%| 
LDd$$tTc
uBf!f!cUTTzjtL L L L L^lVV l l	 l	X 
Yl% l%X $Yl% l%
 ` 
IDd$$tTc
TTeQUddRVTTDI I I I IX[FF [ [	 [	v 
w[% [%v $w[% [%	 ~ 
:Dd$$uTt	
gTf: : : : :z=FF = =	 =	z 
{=% =%z ${=% =%	 B 
=Dd$$
D$	
da$$$v3= = = = =@;FF ; ;	 ;	v 
w;% ;%v $w;% ;%	 ~ 
FDd$$z$TT4C	Bf!t$vq$JF F F F FRB&& B B	 B	D 
EB% B%D $EB% B%L 
?Dd$$z$TdT7et%d64JZz? ? ? ? ?DOFF O O	 O	^ 
_O% O%^ $_O% O%	 f 
KDd$$tTct	&a4e6d	K K K K K\3FF 3 3	 3	f 
g3% 3%f $g3% 3%	 n 
CDd$Wz$T!AE4tTDd44JC C C C CLM&& M M	 M	Z 
[M% M%Z $[M% M%`x x x x x x x xv ,.TUU1 1 1 1 1 1 1 1 1 1rZ   