L i\ddlmZddlZddlZddlmZddlmZddlmZm Z m Z ddl m Z ddl m Z ddlZddlZddlZddlmZdd lmZmZdd lmZmZmZmZmZmZGd d Z Gd de Z!Gdde Z"Gdde Z#GddZ$GddeZ%ddZ&ddZ'dZ(dZ)ddZ*y)) annotationsNcopy) UserString)IterableSequenceMapping)Number)datetime)PlotData) QUAL_PALETTES color_palette)_check_argument_version_predates desaturatelocator_to_legend_entriesget_color_cycle remove_nac@eZdZUdZdZded<dZdZdZdZ dZ dZ y) SemanticMappingz6Base class for mapping data values to plot attributes.Nz str | Nonemap_typec||_yN)plotter)selfrs S/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/seaborn/_base.py__init__zSemanticMapping.__init__+s  cd}t|t|kDrcdjd|dt|ddt|ddg}t|tj|Dcgc]\}}| }}}nUt|t|kDr>djd |d t|ddt|d g}|d t|}|rt j |td |Scc}}w)z/Input check when values are provided as a list. z The z list has fewer values ()z than needed (z) and will cycle, which mayz produce an uninterpretable plot.The z list has more values (z), which may not be intended.N stacklevel)lenjoinzip itertoolscyclewarningswarn UserWarning)rlevelsvaluesvariablemessage_xs r_check_list_lengthz"SemanticMapping._check_list_length4s v;V $hh ":3v;-qIF },GH2 G %( 0G$HIDAqaIFI [3v; &hhxj 7F }AFF },IJ GLS[)F  MM';1 = Js- C2c |j|S)z)Apply the mapping to a single data value. lookup_table)rkeys r_lookup_singlezSemanticMapping._lookup_singleLs  %%rct|ttjtj fr$|Dcgc]}|j |g|i|c}S|j |g|i|Scc}w)z-Get the attribute(s) values for the data key.) isinstancelistnpndarraypdSeriesr:)rr9argskwargsks r__call__zSemanticMapping.__call__Psg cD"**bii8 9EHI'D'';D;F;I I&4&&sr?r,r-tolistisnaallinfer_map_type input_format var_types to_numericnumeric_mappingcategorical_mappingr= saturationrr8paletter/normcmap) rrrcorderrdrbdatamsgrr/r8re __class__s rrzHueMapping.__init__cs !  $$UBIIE,BC grzz *5  MM#! ,nn&G 99;?? "W ca0# **w33W5F5Fu5MH9$}}T*373G3G'440 dD ]*""t'+'?'?'5($ #"t'+'?'?J($ )DO$DM ,D "DL DKDIDIrc |j|}|jdkrt||j}|S#t$r|jYy |j|}tjj |rtj }|j|}n0#t$r$}tj|rd}n|Yd}~nd}~wwxYwYwxYw)z@Get the color for a single value, using colormap to interpolate.N)rrrr) r8KeyErrorrdr>ma is_maskednanre TypeErrorisnanrbr)rr9valuenormederrs rr:zHueMapping._lookup_singles *%%c*E. ??Q udoo6E 3 *yy $ *355??6*VVF &) 88C=(EI  *s:8CB"!AC" C+C C CCCct|tvrd}|S|d}|St|ttfrd}|S|dk(rd}|S|}|S)z'Determine how to implement the mapping.rTrSwide)r r<dictr=)rrcrdr]var_typers rr\zHueMapping.infer_map_typesh m #$H  H$ .$H  V #$H Hrct||}t|}t|trDt |t |z }t |rd}t |j||}||fS|0|ttkr td|} n=td|} n0t|tr|j||d} n t||} tt|| }||fS)z5Determine colors when the hue mapping is categorical.z*The palette dictionary is missing keys: {}Nhuslrc) categorical_orderr'r<rwsetany ValueErrorformatrrr=r5r)) rrgrcrfr/n_colorsmissingrtr8colorss rrazHueMapping.categorical_mappings#4/v; gt $&kCL0G7|B G!455"L |##s?#455*4:F*68sortruniqueColormapr Normalizetupler~scaledasarraydropnar)) rrgrcrdr/rDrrer8rts rr`zHueMapping.numeric_mappingsQ gt $&/*F*0/:Qgaj:F:::,,V4D"<<>L "'')DKKM":; ?@L|T4//E;s F?NNNrk) rFrGrHrIrcrdrerr:r\rar` __classcell__ris@rrMrMXs=CG D DHIHT@  $D)0rrMcBeZdZdZdZ dfd ZdZdZdZdZ xZ S) SizeMappingz8Mapping that sets artist sizes according to data values.Nct |||jjdt j t }|jjr|j|||jd}|dk(r|j|||\}}}} n?|dk(r|j|||\}}d} n!|jt|||\}}d} ||_||_||_||_| |_||_yy)zMap the levels of the `size` variable to distinct values. Parameters ---------- # TODO add generic parameters sizerPrSrTN)rUrrVrWr@rArXnotnar}r\r^r`rar=rr/rdsizes size_ranger8) rrrrfrdrgrr/r8rris rrzSizeMapping.__init__/s !  $$VRYYU-CD ::<   **eW..v6H 9$9=9M9M%:6 dJ ]*'+'?'?%($ " (,'?'?Ju($ " $DM DKDIDJ(DO ,D Q rcJ|d}|St|ttfrd}|S|}|S)NrSrT)r<rwr=)rrdrrxrs rr\zSizeMapping.infer_map_typegs<   H  d| ,$H Hrc* |j|}|S#t$rv|j|}tjj |rtj }|jd|tj|jzz}Y|SwxYw)Nr) r8rlrdr>rmrnrorptp)rr9rrrss rr:zSizeMapping._lookup_singlers J%%c*E   JYYs^Fuuv&OOA&"&&2I)IIE  JsA;BBcbt||}t|trFt|t|z }t |rd|}t ||j }||fSt|tr,|j||d}tt||}||fSt|trt|dk7r5d}t ||d|}t ||jj}tjg|t|ddd}tt||}||fS)Nz(Missing sizes for the following levels: r'A `sizes` tuple must have only 2 values"Value for `sizes` not understood: )r{r<rwr|r}r~rr=r5r)rr'r_default_size_ranger>linspace)rrgrrfr/rrtr8s rrazSizeMapping.categorical_mapping}s;"4/ eT "&kCJ.G7|@ J o% ::rr0minmaxrrrr'r~rrrrrrcliprr)) rrgrrdr/ size_valuesrrt sizes_scaledr8lohis rr`zSizeMapping.numeric_mappings eT ""''$u+./F,,.K[)3{+;;J "'')DKKM":;"3~+>C o%L >$& S!29#,L%h/05c L%f-28+L%h/  >!DK ,D Y rcP||j|}|S|j||}|S)z(Get attribute(s) for a given data point.r7)rr9attrrrs rr:zStyleMapping._lookup_singleGs: <%%c*E %%c*40E rc^|durtt||}|St|tr0t|t|z }|rd|d|}t ||}|St|t r*|j |||}tt||}|S|rd|d|}t |i}|S)z5Handle the specification for a given style attribute.TzThese `z` levels are missing values: zThis `z` argument was not understood: )rwr)r<r|r~rr5)rargr/defaultsrr8rrts rrzStyleMapping._map_attributesOs $;FH 56L T "&kCH,Gv%B7)L o%LX &))&#t> 7C"41SE==J(/  % 7rc b|jdd}|jdd}| |d|_|j|fi|\}}n+d|_t||}|j}|j }||_||_|Dcic]}|t|||dvrdnd c}|_ |Scc}w) z;Define plot variables, optionally using lookup from `data`.r4NrrvlongxyrSrT) boolean_type) rWr]_assign_variables_wideformr framenamesrVrrr^) rrgrr4rrrrVvs rrzVectorPlotter.assign_variabless MM#t $ MM#t $ 9 &D :4::4M9MLE5 !'D  y1IOOEOOE    }a*+t)Y    sB,c |jDcgc] \}}| | }}}t|r>t|dkDrdnd}d|d}|djd|Dz }t ||duxs t| }t |t r|j} n.tjtj|t } td | D } |rtj} i} | | fS| rtj|j} | j | j"j d }i} i} d D]G}||j$vs|j$|}t'| |dd| |<||j$|| |<Itj| } | | fSt |t(rdi|} |rrtj@| d| d<|j0jD] \}}| || |<i} |j0jD]$\}}t'||dd}t'|d d| |<&| tC| } | | fScc}}wcc}}wcc}}w#t:$rd}YwxYw)a5Define plot variables given wide-form data. Parameters ---------- data : flat vector or collection of vectors Data can be a vector or mapping that is coerceable to a Series or a sequence- or mapping-based collection of such vectors, or a rectangular numpy array, or a Pandas DataFrame. kwargs : variable -> data mappings Behavior with keyword arguments is currently undefined. Returns ------- plot_data : :class:`pandas.DataFrame` Long-form data object mapping seaborn variables (x, y, hue, ...) to data vectors. variables : dict Keys are defined seaborn variables; values are names inferred from the inputs (or None when no name can be determined). Nrksr zThe following variablez) cannot be assigned with wide-form data: z, c3(K|] }d|d yw)`NrK.0rs r z;VectorPlotter._assign_variables_wideform..s8!q1X8srPc3nK|]-}t|txrt|ttf /ywr)r<rstrbytesrs rrz;VectorPlotter._assign_variables_wideform..s5  q( # GJq3,,G(G G s35)rrrnameTrrSrr)var_name value_namerid_varsFrK)"rr}r'r(r~r<rwr0r> atleast_1drobjectr@ DataFramerArrindexflat_structurerr enumerater rwide_structurecolumns categoriesorderedadd_categoriesAttributeError to_seriesmelt Categoricalr=)rrgrCrDrassignedrrtemptyr0flatrVr flat_datarrr data_dictir9val wide_data numeric_colsmelt_kws use_indexorig_categories orig_orderedcategory_columnsobjs rrz(VectorPlotter._assign_variables_wideforms.#),,.B$!QAMABB x=8}q(bA*1#-VWC 4998x88 8CS/ ! -CI  dD ![[]F]]2::d&#ABF      IIz)##w  $,,.I$>>#//..E II! E$---..s3D%,YQR%AIcN%*4+>+>s+C%DIcN  E  Y/IN)##}$) 'o4FAs!#vq1C&(YYs^IcN 4 !$(<@JJLISRYYs^+II  T5I(oo/a=3Cy3PL",/I%/iHH D$7$7$>$>$@@I&.#,&/&7&7&B&BO#,#4#4#<#rrr transformgroupbyrWrr*productreversedr'rr@ get_grouprllocrrwr))r grouping_varsrrrr r facet_varsrrgr/axis converterr+ grouped_data grouping_keysr9 iter_keyspd_key data_subsetsub_varss r iter_datazVectorPlotter.iter_dataQsF  M  s +*OM  u - /M J  S03}3EEE  )6O9NO O >>D>>D ;;=D%%' c S%77 T OOD166q9 >>$'=8((. (1'>'>vd|'Lt (*wwtDz/@/@/B'Ct ) 7 7 9 C CI#,Y-D-DVD\-R#SF4L T" <<EEE(LM$ Ajjo$$3;RC@ A"))=9I$T)_5   3"#h!m0A"g0NCFTW/"."8"8"@K$$[M3 78 0 0 222' 3.diik/ !GPf / #'((2,K /s>A2J?4JJ F.J?;J! AJ?!J<9J?;J<<J?c Bt|ds |jSt|ds|jjdjddgdd }d D]}||jvrg}|j|j |j |d }|D]%\}}|j|jtjtj gtj}|j}||jvr!||j|j|}tj|j!|j#t$}|j'j(}|j+tj,|||j.|j0 (|rtj2|} ntj,t$| } |j5d|| ||_|j6S)zFDataframe with numeric x and y, after unit conversion and log scaling.ax _comp_dataF)deepr4rrkignore)r3errorsyxrr)rQrr)hasattrrVrdroprr,r(maskisinr>infrorrr@r_r*astyperXrr+rrArrconcatinsertr>) rr'rpartsgroupedr4origcompr+comp_cols rr'zVectorPlotter.comp_datastT" >> !t\*5!sCjq:   3dnn,..-55dooc6JQV5W'. YOIt99TYY/@%A266JD;;=Ddoo- $DIIdooc.B$CD==)@)@)FGNNuUD ) 7 7 9 C CILL9T?DJJTYY!WX Y!yy/H!yyu3?H  C2+ 3.(DOrcP|jdd}|jdd}|||jj||fS||jj|S||jj|S|j|jjS|jS)z>Return an Axes object based on existence of row/col variables.r#Nr")rWfacets axes_dictr=)rr:r#r"s r _get_axeszVectorPlotter._get_axessll5$'ll5$' ?s;;((#s4 4 _;;((- - _;;((- - WW_;;>> !77Nrcddlm}t||rsd|_||_|j j }|j|j|jd<|j+|j|jd<n||_d|_|g}tdj|j}|gd}nt|tr|g}|D],}|j|}||vsd|d |d |d } t| ddd } i|_|D]}d dd |} t#j$|j&j(|t*} t-|jd|d} | dus| | | k(r t-|d|d| j.ddn| durP|j1D]<\}}|j3|}t-||d| j.|j(<>n~t-|j| d}t5|D]W\}}| dk(r|dfnd|f}t-|jj ||d}|| j.|j&| |k(<Y| |j |<|j&|j7|j |d}|D]U\} }|j|dk(r-|j8|r|j|}nd}t;||}| j=|W|dx}}n |\}}tAd||fD]9\}}|s |D],}t-|d|d}|dur |dd"|d|d.;|jj?d ddk(r#|D]}|jBjEdyy#t$rG|jj?ddk(r|nd}|jj?d dk(r|nd}YwxYw)aAssociate the plotter with an Axes manager and initialize its units. Parameters ---------- obj : :class:`matplotlib.axes.Axes` or :class:'FacetGrid` Structural object that we will eventually plot onto. allowed_types : str or list of str If provided, raise when either the x or y variable does not have one of the declared seaborn types. log_scale : bool, number, or pair of bools or numbers If not False, set the axes to use log scaling, with the given base or defaulting to 10. If a tuple, interpreted as separate arguments for the x and y axes. rk) FacetGridNr"r#rrSr rTr#z variable is z , but one of z is requiredrrr4)rrrQ_shareTrr3F_namesrCrTrSset_scalelogrG) nonpositive)baser^)#axisgridrWr<r=rSaxesflatten col_namesr row_namesr| intersectionrrr^rpr(r@rArVrrrr0r;rUrr,rr{ update_unitsrWr)yaxis set_inverted)rr allowed_types log_scalerWax_listaxis_variablesrrxrt facet_dim other_varr4 share_state axes_vars axes_datar=rr levelidxr3rN seed_datarfscalexscaleyr\ set_scales r_attachzVectorPlotter._attachs0* ( c9 %DGDKhh&&(G}}(),&}}(),&DGDKeGT//?  BM  s +*OM! %C~~c*H},3%}XJm$o\3 n$ % e, !, 2C!,S1I (<(<3fUI!$++u~tDK d"kYy5I&I#*71:#d|#D a %'040@S, 9!^^I69@uD\9R ioo6S$DKKK=1GHE$-e$4S5(3u(>#&-7((- $ 4 $ 1)U CI&&y1 2K, 2b  # #FV V!* tff%56 IKD%!IB 'd4&,> ?I}!%V<!%eH I I >>  c4 (M 9 ,%%d+ , : V&*nn&8&8&=&JPU&*nn&8&8&=&JPU Vs NA O+*O+c|j|jjjDcgc]}t ||d}}|Dchc]}|j }}t |dkDr d}t||dj}n't |j|dj}|j|jjfScc}wcc}w)zDReturn a function implementing the scale transform (or its inverse).r3rkz=Cannot determine transform with mixed scales on faceted axes.r) r=rSrarr get_scaler' RuntimeErrorrr+inverted)rr3r= axis_listscalesrt transform_objs r_get_scale_transformsz#VectorPlotter._get_scale_transformss 77?>Bkk>N>N>S>STvT]3TIT3<=4dnn&=F=6{QV"3''%aL668M$DGGvT];IIKM&& (>(>(@(J(JJJ#U=s C  C%cz|jsMtd|jD}|j|jj d|||j sNtd|jD}|j|jj d||yy)zCAdd axis labels if not present, set visibility to match ticklabels.c3<K|]}|jywr get_visiblerts rrz1VectorPlotter._add_axis_labels..JAMMOJr4)visiblec3<K|]}|jywrrrs rrz1VectorPlotter._add_axis_labels..rrrN) get_xlabelr}get_xticklabels set_xlabelrrW get_ylabelget_yticklabels set_ylabel)rr= default_x default_y x_visible y_visibles r_add_axis_labelszVectorPlotter._add_axis_labelss }}JR5G5G5IJJI MM$..,,S)Add labeled artists to represent the different plot semantics.)autobrieffullz7`legend` must be 'auto', 'brief', 'full', or a boolean.TrNc3VK|] }jj|d"ywr)rrW)rrrs rrz0VectorPlotter.add_legend_data..s" KQT^^  4 ( Ks&)rrkr Fwr)rcolorr linewidthrrc||f}|vr|jdi|yj|tdi||<y)NrK)updaterrw)rval_namekwsr9keys legend_kwss rrz-VectorPlotter.add_legend_data..updatesGH$Cj & 3&&-- C "&++ 3rrrrlabelz.2z3.5.0rK)legendr<rr~rr'poprwr_update_legend_datarW_legend_attributesr0rrlinesLine2Dadd_linepatchesPatch add_patch collections Collectionadd_collection add_artistr legend_title legend_data legend_order)rr=func common_kwsattrs semantic_kws verbosityrttitletitles title_kwsrrrrrr9r3rr level_kws var_attrsr use_attrsartistrrs` @@radd_legend_datazVectorPlotter.add_legend_datasKK i %);T*TKCS/ ! $ I %-R:??3D )1r|7H7H7J  L2J K     &kQ&FJJLQr"  . =#k3-?$OE++- JC  $ $Yy%AQAQRUAV      >>'5 ) 1 NN7 # %CHAuS/CI(()5(;(;(=T9)T$$T$TI " 03;&)$iIdO 0TT'4)S:)S)STF g.fcii&6&67KK' (9(9:LL((B(BC%%f- f%%K     $1 %4"&({ RUs 0 JJ c Xd}t|d|dd} | y| jdk(xr&|dk(xs|dk(xrt| j|kD} | rt | j t jjr!t jj|} n t jj| } t| jt| jf} t| | |j|j!j"\} }n| jgx} }n| jx} }|sB|j$j'|d&||j$|d f|j$|fi||in|}t)| |D]\}}| | |}t |t*r|Dcic]}||}}n|||i}|j-|j/Dcic]\}}||vs |||c}}||j$||fi|ycc}wcc}}w) z1Generate legend tick values and formatted labels.r$r3rNrSrr)numticks)nbinsr)rrr'r/r<rdrrLogNormticker LogLocator MaxNLocatorrrrrV infer_objectsrQrrWr)r=rr)rrrrrr attr_names other_props brief_ticksmapperrlocatorlimitsr/formatted_levelsrrformatted_levelrrrDrs rrz!VectorPlotter._update_legend_datas! 3%t}d3 > 9,   JV#HFMM(:[(H  &++szz'9'9:**///E**00{0C'V]]);;F'@!4!B!B!D!J!J( $F$]] "(* *F%(. 5F%++C6B DNN3'14>>#3F T) T'/b[ &)&2B&C E "E? e}j$/3=>4D$J>D>+&-D [5F5F5HWTQEUVJQ%[WXt~~c*ODtD E?Xs9 H!* H& 7H& ctrNotImplementedErrorrr3rBrCs r scale_nativezVectorPlotter.scale_native:s "!rctrrrs r scale_numericzVectorPlotter.scale_numeric@ "!rctrrrs rscale_datetimezVectorPlotter.scale_datetimeGrrctdddg|||jvr-d|j|<d|j|<d|j|<|j|dk(r"|jj |d |_|j|j }|duxs|j jd k(|j|<tjt||| }|#|j|}|j|}n*|jt}|jt}||j|<d|j|<||j|<|S) a Enforce categorical (fixed-scale) rules for the data on given axis. Parameters ---------- axis : "x" or "y" Axis of the plot to operate on. order : list Order that unique values should appear in. formatter : callable Function mapping values to a string representation. Returns ------- self r3r4rNrTr rS mergesort)kindcategoryrD)rrr^rV sort_valuesrrQrrr@Indexr{maprJrr)rr3rf formattercat_datas rscale_categoricalzVectorPlotter.scale_categoricalNsLT c D1 t~~ %#'DNN4 #0DNN4 #%DNN4  >>$ 9 ,!^^77;7ODN>>$'..0 #(t"3"Xx~~7J7Jj7X$*8U;$G  ||I.HIIi(Es+HLL%E!& -t (t rrrr)NN)r r )rFrGrHrIrrrrpropertyrrrrrrrr;r'rUrxrrrrrrrrrKrrrrhs<Ij:N$)4N B."66  "%)B:L$\ !" !u"e5u"n**X $ G,VK, QCGP)d/El" ""[rrc,eZdZdZdZfdZdZxZS) VariableTypez Prevent comparisons elsewhere in the library from using the wrong name. Errors are simple assertions because users should not be able to trigger them. If that changes, they should be more verbose. rXcN||jvsJ|t| |yr)allowedrUr)rrgris rrzVariableType.__init__s't||#)T)# rcJ||jvsJ||j|k(Sr)rrg)rothers r__eq__zVariableType.__eq__s( $+e+$yyE!!r)rFrGrHrIrrrrrs@rrrs3G"rrcntj|}t|jtjr t dStj |jr t dS|j}tj5tjdttf tj|ddgjrt |cdddS dddtj"j$j'|r t dStj"j$j)|r t dSd }||r t dSd }||r t dSt dS#t $rYwxYw#1swYxYw) a+ Determine whether a vector contains numeric, categorical, or datetime data. This function differs from the pandas typing API in two ways: - Python sequences or object-typed PyData objects are considered numeric if all of their entries are numeric. - String or mixed-type data are considered categorical even if not explicitly represented as a :class:`pandas.api.types.CategoricalDtype`. Parameters ---------- vector : :func:`pandas.Series`, :func:`numpy.ndarray`, or Python sequence Input data to test. boolean_type : 'numeric' or 'categorical' Type to use for vectors containing only 0s and 1s (and NAs). Returns ------- var_type : 'numeric', 'categorical', or 'datetime' Name identifying the type of data in the vector. rTrSr@)actionrrrkNr c6|D]}t|tryyNFT)r<r r4x_is r all_numericz"variable_type..all_numerics# Cc6* rcV|D]$}t|ttjfr$yyr)r<r r> datetime64rs r all_datetimez#variable_type..all_datetimes, CcHbmm#<= r)r@rAr<rQCategoricalDtyperrZr[rr,catch_warnings simplefilter FutureWarningDeprecationWarningr>rHrpapitypesis_numeric_dtypeis_datetime64_dtype)vectorrrrs rrrsp.YYv F&,, 3 34M** wwvI&&]]_F  " }6H&I  wwv1v&**,#L1   -  vv||$$V,I&& vv||''/J''  6I&& FJ''  &&M     s0"F+:0F4F+ F(%F+'F((F++F4c|dn t|}|dn t|}d}d}|bt|jdr%tj|j dd|r |dk7rt |j ddy |bt|jd r%tj|j dd |r |dk7rt |j dd yt|jd s|d k(r#|r |dk7rt |j ddy t|jds|dk(r#|r |dk7rt |j dd y|d t|d }t||d k7r|d k(ry|dk7r|dk(ry |dk(r|dk7ry|rd||fvr d}t |y )aaDetermine how the plot should be oriented based on the data. For historical reasons, the convention is to call a plot "horizontally" or "vertically" oriented based on the axis representing its dependent variable. Practically, this is used when determining the axis for numerical aggregation. Parameters ---------- x, y : Vector data or None Positional data vectors for the plot. orient : string or None Specified orientation. If not None, can be "x" or "y", or otherwise must start with "v" or "h". require_numeric : bool If set, raise when the implied dependent variable is not numeric. Returns ------- orient : "x" or "y" Raises ------ ValueError: When `orient` is an unknown string. TypeError: When dependent variable is not numeric, with `require_numeric` Nz.{} orientation requires numeric `{}` variable.z0{} orientation ignored with only `{}` specified.h HorizontalrrSVerticalr4rz5`orient` must start with 'v' or 'h' or be None, but `z ` was passed.rTz7Neither the `x` nor `y` variable appears to be numeric.) rr startswithr,r-rrpreprr~) r4rorientrequire_numericx_typey_typenonnumeric_dv_errorsingle_var_warningrts r infer_orientrs:YTM!$4FYTM!$4FJKy v; ! !# & MM,33L#F G v2/66z3GH H  v; ! !# & MM,33JD E v2/66|SIJ J V   $# v2/66z3GH H V   $# v2/66|SIJ J   L> 0 o = V}%< 9 9!4 9 9!4 Yvv.>>Gnrcgd}d}t||krtjddg|}tjddg|}tjt t |dddddt |dd}|D]B}t |ttjfd|D}|j|D|dz }t||kr|d|S) aBuild an arbitrarily long list of unique dash styles for lines. Parameters ---------- n : int Number of unique dash specs to generate. Returns ------- dashes : list of strings or tuples Valid arguments for the ``dashes`` parameter on :class:`matplotlib.lines.Line2D`. The first spec is a solid line (``""``), the remainder are sequences of long and short dashes. )r )rR?)rkrk)?rr)rkrkrkrrrRrkrNc3&K|]}|f ywrrK)rseggaps rrz unique_dashes..s*J#C:*Js) r'r*combinations_with_replacementchainr)r=rrr) nrpab segment_listsegmentsspecrs @rrros$F A f+/  3 3QIq A  3 3QFA >! GAbM$B$  GAbM)  % Hh-C*J*JKLD MM$  Q% f+/( "1:rcgd}d}t||krFd|dzz dz }|j|dzd|f|dzd|f|ddf|ddfg|dz }t||krF|d|S)aWBuild an arbitrarily long list of unique marker styles for points. Parameters ---------- n : int Number of unique marker specs to generate. Returns ------- markers : list of string or tuples Values for defining :class:`matplotlib.markers.MarkerStyle` objects. All markers will be filled. ) oX)rRr-P)rRrr)rRrkr^)rRrkr$rrihrkrrN)r'r&)rrrrs rrrs G A g,  1q5MA  UAqM UAqM 1I 1I   Q g,  2A;rcf|Jt|dr |j}n |jj}tt j|}t|S#ttf$rIt j |j}t|dk(rtj|}Y|wxYw)aReturn a list of unique data values. Determine an ordered list of levels in ``values``. Parameters ---------- vector : list, array, Categorical, or Series Vector of "categorical" values order : list-like, optional Desired order of category levels to override the order determined from the ``values`` object. Returns ------- order : list Ordered list of category levels not including null values. rrS)rErcatrprr@rArrr>rfilternotnullr=)rrfs rr{r{s& } 6< (%%E + --rzz5) ;~. + &)002 (I5GGENE  +sAAB0/B0)rS)NNNTr)+ __future__rr,r*rrrcollections.abcrrr numbersr r numpyr>pandasr@ matplotlibrseaborn._core.datar seaborn.palettesr r seaborn.utilsrrrrrrrrMrrrrrrrrr{rKrrr4s""77'8=8=vO0O0dZ6/Z6z[?[BA A H":"(Y'xPf0f+\!r