L iA>dZddlZddlZddlmZddlmZgdZgdZgdZ dd Z d Z d Z d Z dd ZddZddZddZGddeZGddeZGddeZddZy)zGControl plot style and scaling using the matplotlib rcParams interface.N)cycler)palettes) set_themesetreset_defaults reset_orig axes_style set_styleplotting_context set_context set_palette)axes.facecoloraxes.edgecolor axes.gridaxes.axisbelowaxes.labelcolorfigure.facecolor grid.colorgrid.linestyle text.color xtick.color ytick.colorxtick.directionytick.directionlines.solid_capstylepatch.edgecolorpatch.force_edgecolor image.cmap font.familyfont.sans-serif xtick.bottom xtick.top ytick.left ytick.rightaxes.spines.leftaxes.spines.bottomaxes.spines.rightaxes.spines.top) font.sizeaxes.labelsizeaxes.titlesizextick.labelsizeytick.labelsizelegend.fontsizelegend.title_fontsizeaxes.linewidthgrid.linewidthlines.linewidthlines.markersizepatch.linewidthxtick.major.widthytick.major.widthxtick.minor.widthytick.minor.widthxtick.major.sizeytick.major.sizextick.minor.sizeytick.minor.sizect||t|d|it||| tjj |yy)a Set aspects of the visual theme for all matplotlib and seaborn plots. This function changes the global defaults for all plots using the matplotlib rcParams system. The themeing is decomposed into several distinct sets of parameter values. The options are illustrated in the :doc:`aesthetics <../tutorial/aesthetics>` and :doc:`color palette <../tutorial/color_palettes>` tutorials. Parameters ---------- context : string or dict Scaling parameters, see :func:`plotting_context`. style : string or dict Axes style parameters, see :func:`axes_style`. palette : string or sequence Color palette, see :func:`color_palette`. font : string Font family, see matplotlib font manager. font_scale : float, optional Separate scaling factor to independently scale the size of the font elements. color_codes : bool If ``True`` and ``palette`` is a seaborn palette, remap the shorthand color codes (e.g. "b", "g", "r", etc.) to the colors from this palette. rc : dict or None Dictionary of rc parameter mappings to override the above. Examples -------- .. include:: ../docstrings/set_theme.rst r )rc) color_codesN)r r rmplrcParamsupdate)contextstylepalettefont font_scaler@r?s S/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/seaborn/rcmod.pyrrRsDJ$ e-.[1 ~ Bct|i|y)zy Alias for :func:`set_theme`, which is the preferred interface. This function may be removed in the future. N)r)argskwargss rIrr~s tvrJc^tjjtjy)z*Restore all RC params to default settings.N)rArBrCrcParamsDefaultrJrIrrsLL++,rJcNddlm}tjj |y)z@Restore all RC params to original settings (respects custom rc).r_orig_rc_paramsN)rSrArBrCrRs rIr r s!LL(rJc |'tDcic]}|tj|}}n5t|tr|}n!gd}||vrt ddj |d}d}iddd|d d d d d |d |ddddd|ddgdgdddddddddddd d}d!|vr|jd"din|jd"di|jd#r|jd$ddddddd%n<|d&k(r|jd||ddddd%n|d'vr|jd||ddddd%|d(k(r|jddd)n|jddd)|jDcic]\}}|tvs||}}}|=|jDcic]\}}|tvs||}}}|j|t|}|Scc}wcc}}wcc}}w)*a Get the parameters that control the general style of the plots. The style parameters control properties like the color of the background and whether a grid is enabled by default. This is accomplished using the matplotlib rcParams system. The options are illustrated in the :doc:`aesthetics tutorial <../tutorial/aesthetics>`. This function can also be used as a context manager to temporarily alter the global defaults. See :func:`set_theme` or :func:`set_style` to modify the global defaults for all plots. Parameters ---------- style : None, dict, or one of {darkgrid, whitegrid, dark, white, ticks} A dictionary of parameters or the name of a preconfigured style. rc : dict, optional Parameter mappings to override the values in the preset seaborn style dictionaries. This only updates parameters that are considered part of the style definition. Examples -------- .. include:: ../docstrings/axes_style.rst )whitedark whitegriddarkgridtickszstyle must be one of , z.15z.8rrVrroutrrrrTr-rr sans-serifr!)Arialz DejaVu SanszLiberation SanszBitstream Vera Sansr^rroundrwrrrocketr#Fr%gridrrWz#EAEAF2)rrrr&r'r(r)rX)rVrZrZ)r"r$) _style_keysrArB isinstancedict ValueErrorjoinrC startswithitems _AxesStyle) rEr?k style_dictstyles dark_gray light_grayv style_objects rIr r s< }2=>Qaa(> > E4  E  4TYYv5F4GHI I     y u  u   9  9  d  c  )  L>  E! ( #G) * s+ , $T- 0 (1 4 5 6 57 @ U?   T    U    F #   "+")%$(&*%)#'  k !   ")",($(&*%)#'  ( (   ")"+($(&*%)#'   G     $"     %# $.#3#3#5J41ak9I!Q$JJJ ~!xxz >tq!Q+-=ad > >"j)L w?bK?sG2GG G"1G"cZt||}tjj|y)ai Set the parameters that control the general style of the plots. The style parameters control properties like the color of the background and whether a grid is enabled by default. This is accomplished using the matplotlib rcParams system. The options are illustrated in the :doc:`aesthetics tutorial <../tutorial/aesthetics>`. See :func:`axes_style` to get the parameter values. Parameters ---------- style : dict, or one of {darkgrid, whitegrid, dark, white, ticks} A dictionary of parameters or the name of a preconfigured style. rc : dict, optional Parameter mappings to override the values in the preset seaborn style dictionaries. This only updates parameters that are considered part of the style definition. Examples -------- .. include:: ../docstrings/set_style.rst N)r rArBrC)rEr?rrs rIr r /s"8eR(LLL %rJc|&tDcic]}|tj|}}nt|tr|}ngd}||vrt ddj |dddddddd}ddd d dddddd d d d d }|j|t d dd d|}|jD cic] \}} || |z }}} |j} | Dcic] }||||z } }|j| |=|jD cic]\}} |tvs|| }}} |j|t|} | Scc}wcc} }wcc}wcc} }w)a Get the parameters that control the scaling of plot elements. These parameters correspond to label size, line thickness, etc. For more information, see the :doc:`aesthetics tutorial <../tutorial/aesthetics>`. The base context is "notebook", and the other contexts are "paper", "talk", and "poster", which are version of the notebook parameters scaled by different values. Font elements can also be scaled independently of (but relative to) the other values. This function can also be used as a context manager to temporarily alter the global defaults. See :func:`set_theme` or :func:`set_context` to modify the global defaults for all plots. Parameters ---------- context : None, dict, or one of {paper, notebook, talk, poster} A dictionary of parameters or the name of a preconfigured set. font_scale : float, optional Separate scaling factor to independently scale the size of the font elements. rc : dict, optional Parameter mappings to override the values in the preset seaborn context dictionaries. This only updates parameters that are considered part of the context definition. Examples -------- .. include:: ../docstrings/plotting_context.rst )papernotebooktalkposterzcontext must be in r[ )r*r+r,r-r.r/r0g?rg?) r1r2r3r4r5r6r7r8r9r:r;r<r=g?) _context_keysrArBrerfrgrhrCrjkeys_PlottingContext) rDrHr?rl context_dictcontextstexts_base_context base_contextscalingrq font_keys font_dictcontext_objects rIr r OsD4ABq3<<?*B B GT " ; ( "2499X3F2GHI I   !!!%'  #" ! !%!%!"!" ! ! ! !! & ./R!#a@I3?3E3E3GH41a1w;H H'++- >GHQ Q*44H HI& ~!xxz @tq!Q--?ad @ @B&l3N }C^II AsE1E EE!Ec\t|||}tjj|y)a Set the parameters that control the scaling of plot elements. These parameters correspond to label size, line thickness, etc. Calling this function modifies the global matplotlib `rcParams`. For more information, see the :doc:`aesthetics tutorial <../tutorial/aesthetics>`. The base context is "notebook", and the other contexts are "paper", "talk", and "poster", which are version of the notebook parameters scaled by different values. Font elements can also be scaled independently of (but relative to) the other values. See :func:`plotting_context` to get the parameter values. Parameters ---------- context : dict, or one of {paper, notebook, talk, poster} A dictionary of parameters or the name of a preconfigured set. font_scale : float, optional Separate scaling factor to independently scale the size of the font elements. rc : dict, optional Parameter mappings to override the values in the preset seaborn context dictionaries. This only updates parameters that are considered part of the context definition. Examples -------- .. include:: ../docstrings/set_context.rst N)r rArBrC)rDrHr?rs rIr r s%B&gz2>NLL'rJceZdZdZdZdZy) _RCAestheticsctj}|jDcic]}||| c}|_|j |ycc}wN)rArB_keys_orig_set)selfr?rls rI __enter__z_RCAesthetics.__enter__s9 \\(, 31aAh3  $4s Ac:|j|jyr)rr)rexc_type exc_valueexc_tbs rI__exit__z_RCAesthetics.__exit__s $**rJcFtjfd}|S)NcD5|i|cdddS#1swYyxYwrrP)rLrMfuncrs rIwrapperz'_RCAesthetics.__call__..wrappers( -T,V, - - -s) functoolswraps)rrrs`` rI__call__z_RCAesthetics.__call__s%   -  -rJN)__name__ __module__ __qualname__rrrrPrJrIrrs rJrc$eZdZdZeZeeZy)rkz1Light wrapper on a dict to set style temporarily.N) rrr__doc__rdr staticmethodr rrPrJrIrkrks; E  "DrJrkc$eZdZdZeZeeZy)rz3Light wrapper on a dict to set context temporarily.N) rrrrr~rrr rrPrJrIrrs= E  $DrJrctj|||}td|}|tjd<|r tj |yy#t tf$rYywxYw)aSet the matplotlib color cycle using a seaborn palette. Parameters ---------- palette : seaborn color palette | matplotlib colormap | hls | husl Palette definition. Should be something :func:`color_palette` can process. n_colors : int Number of colors in the cycle. The default number of colors will depend on the format of ``palette``, see the :func:`color_palette` documentation for more information. desat : float Proportion to desaturate each color by. color_codes : bool If ``True`` and ``palette`` is a seaborn palette, remap the shorthand color codes (e.g. "b", "g", "r", etc.) to the colors from this palette. See Also -------- color_palette : build a color palette or set the color cycle temporarily in a ``with`` statement. set_context : set parameters to scale plot elements set_style : set the default parameters for figure style colorzaxes.prop_cycleN)r color_paletterrArBset_color_codesrg TypeError)rFn_colorsdesatr@colorscyls rIrrsg2 # #GXu =F & !C&)CLL"#   $ $W -I&   sAA#"A#)rvrYdeepr^rTN)NN)NrN)NNF)rr matplotlibrArrTr__all__rdr~rrrr r r r r rfrrkrrrPrJrIrsM  & P :=CDH) X- ) Zz&@aH"(JD"## %}% rJ