L iVddlmZddlmZddlmZddlZddlmZddl Z ddl Z ddl ZddlmZddlmZmZmZddlmZdd lmZmZdd lmZdd lmZmZmZm Z m!Z!dd l"m#Z#m$Z$dd l%m&Z&m'Z'gdZ(e&jRe'dZ*GddZ+Gdde+Z,e-ededededededededededed Z.Gd!d"e,Z/Gd#d$e,Z0Gd%d&e+Z1d'jee*e'd()e1jf_4ddddddd*d+dd,dd-d-ddddd.d/Z5 d8dddd*d0d1d2d-ddddddd-ddd3d4Z6d5jee*e'd6e'd(7e6_4y)9) annotations)product) signatureN)dedent) VectorPlotter variable_typecategorical_order)handle_data_source) share_axisget_legend_handles)utils)adjust_legend_subtitlesset_hls_values_check_argument _draw_figure_disable_autolayout) color_palette blend_palette)DocstringComponents _core_docs) FacetGridPairGrid JointGridpairplot jointplotparams)corecHeZdZdZdZedZedZdZdZ dZ y) _BaseGridz!Base class for grids of subplots.c f|jjD]}||jdi||S)z$Set attributes on each subplot Axes.)axesflatset)selfkwargsaxs V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/seaborn/axisgrid.pyr%z _BaseGrid.set(s6)).. !B~   ! c|jS)z)DEPRECATED: prefer the `figure` property._figurer&s r)figz _BaseGrid.fig/s||r*c|jS)zHAccess the :class:`matplotlib.figure.Figure` object underlying the grid.r,r.s r)figurez_BaseGrid.figure8s||r*c||g|i||S)ax Pass the grid to a user-supplied function and return self. The `func` must accept an object of this type for its first positional argument. Additional arguments are passed through. The return value of `func` is ignored; this method returns self. See the `pipe` method if you want the return value. Added in v0.12.0. r"r&funcargsr's r)applyz_BaseGrid.apply=s T#D#F# r*c||g|i|S)a Pass the grid to a user-supplied function and return its value. The `func` must accept an object of this type for its first positional argument. Additional arguments are passed through. The return value of `func` becomes the return value of this method. See the `apply` method if you want to return self instead. Added in v0.12.0. r"r3s r)pipez_BaseGrid.pipeLsD*4*6**r*c|j}|jdd|jj|i|y)z Save an image of the plot. This wraps :meth:`matplotlib.figure.Figure.savefig`, using bbox_inches="tight" by default. Parameters are passed through to the matplotlib function. bbox_inchestightN)copy setdefaultr1savefigr&r5r's r)r>z_BaseGrid.savefigZs8-1 T,V,r*N) __name__ __module__ __qualname____doc__r%propertyr/r1r6r8r>r"r*r)r r %sA+  + -r*r cTeZdZdZdZdZdZdZ d dZdZ d Z e d Z d d Z y)Gridz>A grid that can have multiple subplots and an external legend.FTc2gd|_d|_d|_y)N)rrrrF)_tight_layout_rect_tight_layout_pad_extract_legend_handlesr.s r)__init__z Grid.__init__ls".!%(-$r*c|j}|jd|j|j|jd|j|jj |i||S)z:Call fig.tight_layout within rect that exclude the legend.rectpad)r<r=rHrIr- tight_layoutr?s r)rOzGrid.tight_layoutusc&$"9"9:  ! ! -   eT%;%; <! !!4262 r*Nc 0| |j}|S|jt|j}n-tt t j |j}tjjdd}|Dcgc]}|j||}}| |jn|}tjd} g} |D]+} t| tr| \} } n| } | j| -|j!dd|j"r|j!dd|j!dd |j$j&|| fi|}||_|j+|d | i |r t-|t/|j$|j1j2|j$j4z }|j$j7\}}|j$j9||z|t/|j$|j1j2|j$j4z }|||zz }|j:rd nd }||z|_d|j<z }|j$j?|||j@d<|S|jBjDd}|j!dd|j&|| fi|}|j+|d | i ||_|r t-||Scc}w)aDraw a legend, maybe placing it outside axes and resizing the figure. Parameters ---------- legend_data : dict Dictionary mapping label names (or two-element tuples where the second element is a label name) to matplotlib artist handles. The default reads from ``self._legend_data``. title : string Title for the legend. The default reads from ``self._hue_var``. label_order : list of labels The order that the legend entries should appear in. The default reads from ``self.hue_names``. adjust_subtitles : bool If True, modify entries with invisible artists to left-align the labels and set the font size to that of a title. kwargs : key, value pairings Other keyword arguments are passed to the underlying legend methods on the Figure or Axes object. Returns ------- self : Grid instance Returns self for easy chaining. r)alpha linewidthzlegend.title_fontsize scatterpointsrframeonFlocz center rightsize)propg{Gz?{Gz?)rightbest)# _legend_data hue_nameslistkeysmaprto_utf8mplpatchesPatchget_hue_varrcParams isinstancetupleappendr= _legend_outr-legend_legend set_titlerrget_window_extentwidthdpiget_size_inchesset_size_inches_margin_titles _space_neededsubplots_adjustrHr#r$)r& legend_datatitle label_orderadjust_subtitlesr' blank_handlelabhandles title_sizelabelsentry_label figlegend legend_width fig_width fig_height space_neededmarginrYr(legs r) add_legendzGrid.add_legend~s:  ++K  ~~%";#3#3#56 "3u}}dnn#EF {{((qA(> ALM#;??3 5MM!& E\\"9:   !E%' 5 MM%  ! /1-      i /   e^ 4, ++GVFvFI$DL   VZ,@  A' 2  &%668>>AQAQQL$(LL$@$@$B !Iz LL ( (\)A: N  &%668>>AQAQQL'9|+CDL //SSF!',!6D ***E LL ( (u ( 5).D # #A & "B   eV ,"))GV6v6C MM%vz&:M ;DL', ANs Lc i}|j|jrut|j}|jjDcgc]}|j }}|j t ||Dcic]\}}|| c}}|j\}}|j t ||Dcic]\}}|| c}}|jj |d|_ycc}wcc}}wcc}}w)z8Extract the legend data from an axes object and save it.N) legend_rJr textsget_textupdatezipget_legend_handles_labelsr\)r&r(datar}trhandlers r)_update_legend_datazGrid._update_legend_datas :: !d&B&B(4G,.JJ,<,<=qajjl=F= KKCQNsC5; C: = D cn|td}|St|||}t|}|s= B2c: |jS#t$rYywxYw)z9The :class:`matplotlib.legend.Legend` object, if present.N)rmAttributeErrorr.s r)rlz Grid.legends# <<   s  c d|jjD]}|jdd|i||S)aModify the ticks, tick labels, and gridlines. Parameters ---------- axis : {'x', 'y', 'both'} The axis on which to apply the formatting. kwargs : keyword arguments Additional keyword arguments to pass to :meth:`matplotlib.axes.Axes.tick_params`. Returns ------- self : Grid instance Returns self for easy chaining. axisr")r1r# tick_params)r&rr'r(s r)rzGrid.tick_paramss8"++"" 0B BNN / / / 0 r*)NNNF)both)r@rArBrCrtrkrKrOrrrrDrlrr"r*r)rFrFgsMHNK-DH$)fP&<r*rFz data : DataFrame Tidy ("long-form") dataframe where each column is a variable and each row is an observation. zq row, col : vectors or keys in ``data`` Variables that define subsets to plot on different facets. z {row,col}_order : vector of strings Specify the order in which levels of the ``row`` and/or ``col`` variables appear in the grid of subplots. z col_wrap : int "Wrap" the column variable at this width, so that the column facets span multiple rows. Incompatible with a ``row`` facet. z share{x,y} : bool, 'col', or 'row' optional If true, the facets will share y axes across columns and/or x axes across rows. zW height : scalar Height (in inches) of each facet. See also: ``aspect``. z aspect : scalar Aspect ratio of each facet, so that ``aspect * height`` gives the width of each facet in inches. a palette : palette name, list, or dict Colors to use for the different levels of the ``hue`` variable. Should be something that can be interpreted by :func:`color_palette`, or a dictionary mapping hue levels to matplotlib colors. z legend_out : bool If ``True``, the figure size will be extended, and the legend will be drawn outside the plot on the center right. z margin_titles : bool If ``True``, the titles for the row variable are drawn to the right of the last column. This option is experimental and may not work in all cases. zU facet_kws : dict Additional parameters passed to :class:`FacetGrid`. ) rrowcol rowcol_ordercol_wrapshare_xyheightaspectr legend_out margin_titles facet_kwsc~eZdZdZddddddddddddddddddddddfd Zed j d$iee_d Zd Z d Z d Z dZ dZ d%dZdZd&dZd'dZd'dZd(dZd)dZd*dZddddddZedZedZedZedZed Zed!Zed"Zed#ZxZ S)+rz7Multi-plot grid for plotting conditional relationships.NTrF)rowcolrrsharexshareyrrr row_order col_orderrhue_kwsdropnardespinerxlimylim subplot_kws gridspec_kwsc8 t.|t|}|}|d}nt||| }|j ||| | }|g}nt||| }|g}nt||| }||ni}t j t|t}|rO||n||j}||n||j}||n||j}||z|z} n|} |dn t|}!|dn t|}"|!|"z|_ ||_ |;| d}#t|#|}!tt jt||z }"|!|_|"|_|!|z| z|"|zf}$|d}|in|j#}|in|j#}|||d<|||d<t%5t'j(|$}%ddd|t+d||||}&%j,|"|!fi|&}'||i}(n| t+t/||'j0}(n| t+t/||'j0}(nt3||})t+t/|)|'j0}(n|rt5j6dt|}*t j8|*t:}'%j<|"|!dfi||'d <|r|'d |d <|r|'d |d <t?d|*D]}+|%j<|"|!|+dzfi||'|+<t+t/||'}(|%|_ |'|_!|(|_"d|_#||_$||_%||_&||_'||_(|"|_||_)|!|_||_*||_+g|_,||_ ||_-||_.||_/i|_0d|_1d|_2||_3||_4||_5| |_6|jo|jq|r|js|d vr|jtD]r},|,jwD]}-|-jyd|,jzj|jyd|,jzj~jydt|d vr|jD]r},|,jD]}-|-jyd|,jj|jyd|,jj~jydtyy#1swYExYw)Nrz)Cannot use `row` and `col_wrap` together.Frrfigsize)squeezerr subplot_kw gridspec_kwz,`gridspec_kws` ignored when using `col_wrap`rrr)Tr)Tr)CsuperrKr r rnpzerosrboolisnull _n_facets _col_wrap ValueErrorintceil_ncol_nrowr<rpltr1rsubplotsrr$rwarningswarnemptyobject add_subplotranger-_axes _axes_dictrmr row_names col_namesr]r_row_var_col_varrt_margin_titles_textsrf_colorsrkr\_x_var_y_var_sharex_sharey_dropna_not_na set_titlesrOr_not_bottom_axesget_xticklabels set_visiblexaxis offsetTextr_not_left_axesget_yticklabelsyaxis)/r&rrrrrrrrrrrrrrrrrrrrrrhue_varr]rrrnone_narow_nacol_nahue_nanot_nancolnrowerrrr/r'r# axes_dict facet_productn_axesir(r __class__s/ r)rKzFacetGrid.__init__ssE !$' ;I)$s)Y?I""4iA ;I)$s)Y?I ;I)$s)Y?I%0'b((3t9d+  # Wc1A1A1CF # Wc1A1A1CF # Wc1A1A1CF/0FXFKqS^KqS^!  A o%Drwws9~89:D  &=6)4&=9  !M(/b[5E5E5G )1r|7H7H7J  "&K   "&K ! " .**W-C .  %!'%0&24F  3<<d5f5D{s{  Y !:;  Y !:; ' 9 =  ]DII!>?  LM^F88FF+D%coodD!C{CDG(,Q H%(,Q H%1f% L)#//$a!eK{KQ LSD12I   #  """     +$&!!  %          LLN ] "++ 2//1-E%%e,-##//6**51  2 ] ")) 2//1-E%%e,-##//6**51  2 #y . .s 5TTa? Initialize the matplotlib figure and FacetGrid object. This class maps a dataset onto multiple axes arrayed in a grid of rows and columns that correspond to *levels* of variables in the dataset. The plots it produces are often called "lattice", "trellis", or "small-multiple" graphics. It can also represent levels of a third variable with the ``hue`` parameter, which plots different subsets of data in different colors. This uses color to resolve elements on a third dimension, but only draws subsets on top of each other and will not tailor the ``hue`` parameter for the specific visualization the way that axes-level functions that accept ``hue`` will. The basic workflow is to initialize the :class:`FacetGrid` object with the dataset and the variables that are used to structure the grid. Then one or more plotting functions can be applied to each subset by calling :meth:`FacetGrid.map` or :meth:`FacetGrid.map_dataframe`. Finally, the plot can be tweaked with other methods to do things like change the axis labels, use different ticks, or add a legend. See the detailed code examples below for more information. .. warning:: When using seaborn functions that infer semantic mappings from a dataset, care must be taken to synchronize those mappings across facets (e.g., by defining the ``hue`` mapping with a palette dict or setting the data type of the variables to ``category``). In most cases, it will be better to use a figure-level function (e.g. :func:`relplot` or :func:`catplot`) than to use :class:`FacetGrid` directly. See the :ref:`tutorial ` for more information. Parameters ---------- {data} row, col, hue : strings Variables that define subsets of the data, which will be drawn on separate facets in the grid. See the ``{{var}}_order`` parameters to control the order of levels of this variable. {col_wrap} {share_xy} {height} {aspect} {palette} {{row,col,hue}}_order : lists Order for the levels of the faceting variables. By default, this will be the order that the levels appear in ``data`` or, if the variables are pandas categoricals, the category order. hue_kws : dictionary of param -> list of values mapping Other keyword arguments to insert into the plotting call to let other plot attributes vary across levels of the hue variable (e.g. the markers in a scatterplot). {legend_out} despine : boolean Remove the top and right spines from the plots. {margin_titles} {{x, y}}lim: tuples Limits for each of the axes on each facet (only relevant when share{{x, y}} is True). subplot_kws : dict Dictionary of keyword arguments passed to matplotlib subplot(s) methods. gridspec_kws : dict Dictionary of keyword arguments passed to :class:`matplotlib.gridspec.GridSpec` (via :meth:`matplotlib.figure.Figure.subplots`). Ignored if ``col_wrap`` is not ``None``. See Also -------- PairGrid : Subplot grid for plotting pairwise relationships relplot : Combine a relational plot and a :class:`FacetGrid` displot : Combine a distribution plot and a :class:`FacetGrid` catplot : Combine a categorical plot and a :class:`FacetGrid` lmplot : Combine a regression plot and a :class:`FacetGrid` Examples -------- .. note:: These examples use seaborn functions to demonstrate some of the advanced features of the class, but in most cases you will want to use figue-level functions (e.g. :func:`displot`, :func:`relplot`) to make the plots shown here. .. include:: ../docstrings/FacetGrid.rst c#8K|j}|jr*|jDcgc]}||j|k(}}n*tjdt |jg}|j r*|j Dcgc]}||j|k(}}n*tjdt |jg}|jr*|jDcgc]}||j|k(}}n*tjdt |jg}tt|t|t|D]0\\}}\}} \} } ||| z| z|jz} ||| f| f2ycc}wcc}wcc}ww)aGenerator for name indices and data subsets for each facet. Yields ------ (i, j, k), data_ijk : tuple of ints, DataFrame The ints provide an index into the {row, col, hue}_names attribute, and the dataframe contains a subset of the full data corresponding to each facet. The generator yields subsets that correspond with the self.axes.flat iterator, or self.axes[i, j] when `col_wrap` is None. TN) rrrrrepeatrrrr]rfr enumerater) r&rn row_masks col_masks hue_masksrrjrkrdata_ijks r) facet_datazFacetGrid.facet_datasmyy >>;?>>Jadmm,1JIJ4TYY89I >>;?>>Jadmm,1JIJ4TYY89I >>;?>>Jadmm,1JIJ4TYY89I-4Ii4H4=i4H4=i4H-J & (HQhq#CC#IOdll:;Ha)X% %  &#K K Ks+'FF AF F"AF)FBFc2|jdd}tt|dd}|dk(rvd|vr0dj|j}t j |t|dk(r4d |vr0d j|j}t j ||jD]@\\}}} } | jjs"|jd  } |j||| } |j| ||d<|jjD] \} }|| || <|j %t#j$|j&| |d <| t)|}|j*r|j-}|jDcgc]\}}| }}}|jd r|Dcgc]}|j}}|j/|| ||C|j1|dd|Scc}}wcc}w)a=Apply a plotting function to each facet's subset of the data. Parameters ---------- func : callable A plotting function that takes data and keyword arguments. It must plot to the currently active matplotlib Axes and take a `color` keyword argument. If faceting on the `hue` dimension, it must also take a `label` keyword argument. args : strings Column names in self.data that identify variables with data to plot. The data for each variable is passed to `func` in the order the variables are specified in the call. kwargs : keyword arguments All keyword arguments are passed to the plotting function. Returns ------- self : object Returns self. colorNrAzseaborn.categoricalorderzXUsing the {} function without specifying `order` is likely to produce an incorrect plot.rrz\Using the {} function without specifying `hue_order` is likely to produce an incorrect plot.seabornr matplotlibrZ)popstrgetattrformatr@rrrr valuesrV startswith facet_axis _facet_colorritemsrfrrar]r^rr _facet_plot_finalize_grid)r&r4r5r'kw_color func_modulewarningrow_icol_jhue_kr  modify_stater(kwval_list plot_datar v plot_argss r)r`z FacetGrid.maps 0::gt,'$ b9:  / /f$##)6$--#8 g&4yA~+V";##)6$--#8 g&04/@ : + !UE58??'' +55i@@L|>yIIL|zz#t,fjjd.CD Ra) !FAs KN ! K( r*c2|j|}||S||SyN)r)r& hue_indexrr s r)rzFacetGrid._facet_colorDs+ Y'  O  Lr*ct|jjdr4|j}gd}t ||D] \}}|||< g}||d<||i||j |y)Nr)r*r+rrVstyler()rrArr<rr)r&r4r(r( plot_kwargs semanticskeyr-s r)rzFacetGrid._facet_plotLs~ t  * *9 5%**,K:I 95 'S#& C  'I "K  i';'   $r*cB|j||jy)z$Finalize the annotations and layout.N)set_axis_labelsrO)r&axlabelss r)rzFacetGrid._finalize_grid[sh' r*c|j|jj|}n|j||f}|rtj||S)z?Make the axis identified by these indices active and return it.)rr#r$rsca)r&r r!r#r(s r)rzFacetGrid.facet_axis`sG >> %&B5%<(B  GGBK r*c Ftj|jfi||S)z#Remove axis spines from the facets.)rrr-)r&r's r)rzFacetGrid.despinens dll-f- r*c ~|||_|j|fd|i||||_|j|fd|i||S)z>Set axis labels on the left column and bottom row of the grid. clear_inner)r set_xlabelsr set_ylabels)r&x_vary_varr>r's r)r8zFacetGrid.set_axis_labelsssU  DK D  U F Fv F  DK D  U F Fv F r*c | |j}|jD]}|j|fi||r"|jD]}|jd|S)z/Label the x axis on the bottom row of the grid.r)r _bottom_axes set_xlabelrr&rr>r'r(s r)r?zFacetGrid.set_xlabels~sa =KKE## +B BMM% *6 * + ++ " b! " r*c | |j}|jD]}|j|fi||r"|jD]}|jd|S)z0Label the y axis on the left column of the grid.r)r _left_axes set_ylabelrrFs r)r@zFacetGrid.set_ylabelss_ =KKE// +B BMM% *6 * + )) " b! " r*c |jjD]}|j}|j||p|j Dcgc]}|j }}|/|jdd|}|dd|}|j||j |fi||j |fi||Scc}w)z#Set x axis tick labels of the grid.N)r#r$ get_xticks set_xticksrrset_xticklabels) r&rstepr'r( curr_ticksr curr_labelsxtickss r)rMzFacetGrid.set_xticklabelss)).. 5BJ MM* %~=?=O=O=QREu~~/R R#]]_VtV4F"-ff"5KMM&)""";9&9"""64V4 5 SsCc 0|jjD]w}|j}|j||?|j Dcgc]}|j }}|j |fi|e|j |fi|y|Scc}w)z6Set y axis tick labels on the left column of the grid.)r#r$ get_yticks set_yticksrrset_yticklabels)r&rr'r(rOrrPs r)rUzFacetGrid.set_yticklabelss)).. 5BJ MM* %~=?=O=O=QREu~~/R R""";9&9"""64V4 5 SsBc t|j|j}|jdtj d|d<|d}|d}|1|j|}n"|j|}ndj ||g}tj|}tj|}tj|}|jr=|jD]}|jg|_ |jt|jD]w\}}|j|df} |jt||j di|} | j"| fd d d d d d|}|jj%|y|j&lt|j&D]T\} } |jt| |j di|} |jd| fj(| fi|V|S|j|jt|jD]r\}}t|j&D]U\} } |jt|| |j di|} |j|| fj(| fi|Wt|S|jt+|jrnt|jD]T\}}|jt||j di|} |j|dfj(| fi|V|S|j&t+|j&rtt|j&D]\\}} |jt| |j di|} |jj,|j(| fi|^|S)aDraw titles either above each facet or on the grid margins. Parameters ---------- template : string Template for all titles with the formatting keys {col_var} and {col_name} (if using a `col` faceting variable) and/or {row_var} and {row_name} (if using a `row` faceting variable). row_template: Template for the row variable when titles are drawn on the grid margins. Must have {row_var} and {row_name} formatting keys. col_template: Template for the column variable when titles are drawn on the grid margins. Must have {col_var} and {col_name} formatting keys. Returns ------- self: object Returns self. )row_varcol_varrVzaxes.labelsizez{row_var} = {row_name}z{col_var} = {col_name}z | )row_name)gRQ??z axes fractionileftcenter)xyxycoordsrotationhava)col_namer)rZrcr")rrrrrbrgjoinrrartrremoverrr#rrannotaterjrrnrr$) r&template row_template col_templater'r5textrrZr(rxrrcs r)rzFacetGrid.set_titless,DMM4==AFCLL9I,JKv  3L  3L  }}$'&' ::|\&BC}}\2 }}\2 ==*   11   (*D %~~)#,T^^#< ;KAx1b5)BKKh 78/L//7$7E&2;;",!$H!D --44T: ;~~)#,T^^#<?KAxKKh 78/L//7$7E-DIIadO--e>v>? K MM %DMM,E(8 ? 8#,T^^#<?KAxKKh JK+HOO3d3E-DIIadO--e>v>? ?  ^^ 'C,?(8 ; 8 D(34'/$/) !Q$))%:6: ; ^^ 'C,?(8 = 8 D(34'/$/+ q!++E` Specifies the color of the reference line(s). Pass ``color=None`` to use ``hue`` mapping. linestyle : str Specifies the style of the reference line(s). line_kws : key, value mappings Other keyword arguments are passed to :meth:`matplotlib.axes.Axes.axvline` when ``x`` is not None and :meth:`matplotlib.axes.Axes.axhline` when ``y`` is not None. Returns ------- :class:`FacetGrid` instance Returns ``self`` for easy method chaining. r rmr*r+)r`raxvlineaxhline)r&r*r+r rmline_kwss r)reflinezFacetGrid.refline s_." ) = DHHS[[ 2A 2 2 = DHHS[[ 2A 2 2 r*c|jS)zBAn array of the :class:`matplotlib.axes.Axes` objects in the grid.)rr.s r)r#zFacetGrid.axes/szzr*cl|jjdk(r|jdSd}t|)zJThe :class:`matplotlib.axes.Axes` when no faceting variables are assigned.)rr)rrz> !99SbS!"W%** *Djj4::->G"499- $2 NFTZZ4::>:;FTZZ4::>:WDE KKO $88D&).. .r*c|j|jdddfjSg}t|jD]&\}}||jzr|j |(t j|tjS)z/Return a flat array of the left column of axes.Nr rr#r$rrrjrryrr&r#rr(s r)rHzFacetGrid._left_axes^sv >> !99QT?'' 'D"499- $24::~KKO $88D&).. .r*c |j|jddddfjSg}t|jD]&\}}||jzs|j |(t j|tjS)z;Return a flat array of axes that aren't on the left column.Nrr~rs r)rzFacetGrid._not_left_axesjsy >> !99QU#(( (D"499- $2tzz>KKO $88D&).. .r*c|j|jdddfjSg}|j|jz|j z }t |jD]\\}}||j|jdz zk\xs"||j|jdz z|z k\}|sL|j|^tj|tjS)z.Return a flat array of the bottom row of axes.NrYrrxrzs r)rDzFacetGrid._bottom_axesvs >> !99RU#(( (Djj4::->G"499- $2$** Q78FTZZ4::>:WDEKKO  $88D&).. .r*c|j|jddddfjSg}|j|jz|j z }t |jD]\\}}||j|jdz zkxr"||j|jdz z|z k}|sL|j|^tj|tjS)z:Return a flat array of axes that aren't on the bottom row.NrYrrxrzs r)rzFacetGrid._not_bottom_axess >> !99SbS!V$)) )Djj4::->G"499- $2tzzA~67FTZZ4::>:WDEKKO  $88D&).. .r*r")T)NNT)NT)NNr0)NNN)!r@rArBrCrKrr _facet_docsr r`r.rrrrrr8r?r@rMrUrrrrDr#r(rr|rHrrDr __classcell__rs@r)rrpssA dtD1d$$t$Ttr2hZvZ Z tVuZ#t"uZ#Hx&&PPdEN %     Yv 4tt H&&//" / / / /// //r*rceZdZdZdddddddddddddddfd Zd Zd Zd Zd ZdZ dZ dZ dZ dZ dZdZxZS)raISubplot grid for plotting pairwise relationships in a dataset. This object maps each variable in a dataset onto a column and row in a grid of multiple axes. Different axes-level plotting functions can be used to draw bivariate plots in the upper and lower triangles, and the marginal distribution of each variable can be shown on the diagonal. Several different common plots can be generated in a single line using :func:`pairplot`. Use :class:`PairGrid` when you need more flexibility. See the :ref:`tutorial ` for more information. NFT@rr[)rvarsx_varsy_varsrrrcorner diag_shareyrr layout_padrrc2t|t|}|j|}||vr|j ||t |}t |}||}||}t j|r|g}t j|r|g}t |x|_}t |x|_ }|j|jk(|_ |s td|s tdt|| z| zt|| zf}t5tj|}dddj!t|t|ddd}| |_| rBt j$|d }t'|D]!\}}|||fj d|||f<#||_||_||_| |_d|_d|_||_|j7||_|>d gx|_}t=j>d gt|z|j@ |_!nGtE|||x}}|r#t tGt<jH|}||_|||_!||ni|_%||_&||_'|jQ|||||_)i|_*|dd ddfjVD]u}||jYD]}|j[d|j\j^j[d|j\j`j[dw|ddd dfjVD]u}||jcD]}|j[d|jdj^j[d|jdj`j[dwgd |_3| |_4||_5|rtmjn||jq| y#1swYxYw)acInitialize the plot figure and PairGrid object. Parameters ---------- data : DataFrame Tidy (long-form) dataframe where each column is a variable and each row is an observation. hue : string (variable name) Variable in ``data`` to map plot aspects to different colors. This variable will be excluded from the default x and y variables. vars : list of variable names Variables within ``data`` to use, otherwise use every column with a numeric datatype. {x, y}_vars : lists of variable names Variables within ``data`` to use separately for the rows and columns of the figure; i.e. to make a non-square plot. hue_order : list of strings Order for the levels of the hue variable in the palette palette : dict or seaborn color palette Set of colors for mapping the ``hue`` variable. If a dict, keys should be values in the ``hue`` variable. hue_kws : dictionary of param -> list of values mapping Other keyword arguments to insert into the plotting call to let other plot attributes vary across levels of the hue variable (e.g. the markers in a scatterplot). corner : bool If True, don't add axes to the upper (off-diagonal) triangle of the grid, making this a "corner" plot. height : scalar Height (in inches) of each facet. aspect : scalar Aspect * height gives the width (in inches) of each facet. layout_pad : scalar Padding between axes; passed to ``fig.tight_layout``. despine : boolean Remove the top and right spines from the plots. dropna : boolean Drop missing values from the data before plotting. See Also -------- pairplot : Easily drawing common uses of :class:`PairGrid`. FacetGrid : Subplot grid for plotting conditional relationships. Examples -------- .. include:: ../docstrings/PairGrid.rst Nz$No variables found for grid columns.z!No variables found for grid rows.rrrF)rrrr _nolegend_)indexrY)rXrXGz?r)r/)rN)9rrKr _find_numeric_colsrer^risscalarrr square_gridrrrrr1r_cornertriu_indices_fromrr-r#rr diag_vars diag_axesr_add_axis_labelsrfr]pdSeriesrhue_valsr filternotnullr _orig_palette _hue_orderrrr\r$rrrrrrrrHrI_despinerrrO)r&rrrrrrrrrrrrrrr numeric_colsrr/r# hide_indicesrrr]r(rrs r)rKzPairGrid.__init__sp !$'..t4 ,     $  $ZF$ZF >!F >!F ;;v XF ;;v XF#F|+ f#F|+ f;;$++5CD D@A Af+&/Vv1EE " .**W-C .||CKV#($)+ //a8L\* "1QT !!#!QT  "   '   ;*6 7DNYII|ns4y&@,0JJ8DM%6d3i$K KI   I!>? &DN IDM#*"5w2 $#((sIwG ssAv,## .Bz++- )!!%( ) HH   + +E 2 HHNN & &u -  .q!"u+"" .Bz++- )!!%( ) HH   + +E 2 HHNN & &u -  .#7!+  MMc " j)k . .s P  Pc tj|jj\}}t |j |j }|j ||fi||S)aMPlot with the same function in every subplot. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. )rindicesr#rurr$_map_bivariate)r&r4r' row_indices col_indicesrs r)r`z PairGrid.mapVsS$&::diioo#> [k&& (8(89D'4V4 r*c zttj|jd}|j||fi||S)a^Plot with a bivariate function on the lower diagonal subplots. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. rY)rrtril_indices_fromr#rr&r4r'rs r) map_lowerzPairGrid.map_lowergs;r++DIIr:;D'4V4 r*c zttj|jd}|j||fi||S)a^Plot with a bivariate function on the upper diagonal subplots. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. r)rrrr#rrs r) map_upperzPairGrid.map_uppervs;r++DIIq9:D'4V4 r*c X|jr4|j|fi||js|j|fi||Sg}t |j D];\}}t |j D]\}}||k7s |j||f =|j||fi||S)a\Plot with a bivariate function on the off-diagonal subplots. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. ) rrrrrrrrjr)r&r4r'rrrBrrAs r) map_offdiagzPairGrid.map_offdiags    DNN4 *6 *<<t.v. G' 4 / E"+DKK"8/JA~1v./ / D  g 8 8 r*c  |jsg}g}t|jD] \}}t|jD]\}}||k(s |j ||j ||f} | j } | j|j | tjjdds6| jjD]} | jjd|js| jjd|j st#j$| d#|j&r|r|ddD]} t)|d| d||_||_d t-|j.vr|j0|fi|St3|j*|jD]$\} } |j5} t7|j8j;d r| | d <ntj<| |j>| }|j@|j>|j@}nd}|jBr1|jE}|||jEz}||}|||}| jGd || jGd |jH| jGd |jJ|dd|i| d| _&'|jO|S)aYPlot with a univariate function on each diagonal subplot. Parameters ---------- func : callable plotting function Must take an x array as a positional argument and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. Nz ytick.leftTFr(r\rrr+rrr(rrr*r")(rrrrrjr#twinx set_axis_offrrgrer majorTicks tick1linerrrrrrr rr parameters_map_diag_iter_huerr<rrArr;rrfrnotnar=rrrr)r&r4r'rrrrBrrAr(diag_axtickvarr4vectorrrs r)map_diagzPairGrid.map_diags >> !II%dkk2 @5 )$++ 6@HAu~"((/!YYq!t_"$((*,,.!((1 #||// dC(*(;(;B $ : :5 AB <<HH007#}} % $ ?)@ @2I#AB-6By|R56'DN&DN  $22 2*4**4:6: :4>>4>>: GC ++-K4??#..y9$& D! YYs^F}}(ii .||?ciik)F?f+C  " "5# .  " "; @  " "9d.@.@ A  )6 )[ )BJ5 8  r*c &|jdd}t|j|jD] \}}|j|j |j d}|j}t|jjdr||d<ntj|t|jD]\}} |j| } ||j(|} n|} |j*rt-j.| } t|jjdr |d | | | d|~|| f| | d |#|j1|S#t $rt#j$gt&} YwxYw) z>4>>: LGC))C.000NK ++-K4??#..y9$& D! '8 L 78(227;F& LLOE'E<<"__V4Ft'229=M6MMKweK{K' L L<  % 8YYr7F8sE))$FFc zddlm}m}||us||urd|_|j }|D]M\}}|j |} |j |} |j||f} | 8|j| | | |fi|O|jdt|jvrt|j|_yy)z,Draw a bivariate plot on the indicated axes.rhistplotkdeplotTNr) distributionsrrrJr<rrr#_plot_bivariaterrrr^r\r]) r&r4rr'rrkwsrrrArBr(s r)rzPairGrid._map_bivariates 5 8 tw+/D (kkm @DAqKKNEKKNE1a4Bz D r4 ?3 ?  @  IdO.. .!$"3"34DN /r*c dt|jvr|j||||fi|y|j}t |j j dr||d<ntj|||k(r|g}n||g}|j)|j|vr|j|j|j|}|jr|j}||}||} |jd} n|j|j} d|vr)|j| |j |j"d|d|| d||j%|y)z,Draw a bivariate plot on the specified axes.rNrr()rrrr*r+r")rr_plot_bivariate_iter_huer<rrArrr;rfrjrrrrerrrr) r&rArBr(r4r' axes_varsrr*r+rs r)rzPairGrid._plot_bivariate,sE  $22 2 )D ) )%D KF K  t  * *9 5F4L GGBK E>II == $i)G   T]] +yy# <<;;=D K K == C((4==)C   MMTEWEW   qA     $r*c x|j}t|jjdr||d<nt j |||k(r|g}n||g}|j j|jd}t|jD]\}} |j} |j| } |j r| |j#} | |} | |} |j$j'D] \}}||| |<| j)d|j*||j,| | d<t|jjdr |d | | d | || | fi| |j/|y#t$rtj|t} YwxYw) z7Draw a bivariate plot while iterating over hue subsets.rr(Tr)columnsrr Nrrr")r<rrArrr;rrrrrrrr DataFramerrrrrr=rrfr)r&rArBr(r4r'rrr rrrr*r+r$r%s r)rz!PairGrid._plot_bivariate_iter_hueSs t  * *9 5F4L GGBK E>IIii'' 'E #DOO4 "JAw++-C 3$..w7 || *113u Au A $ 2 2 4 & H"1+B & NN7DLLO 4}}(&G 4??#..y9%qA%%Q!S!5 "8   $+ 3i,13 3s0F$F98F9ct|jdddf|jD]\}}|j|t|jdddf|jD]\}}|j |y)z'Add labels to the left and bottom Axes.rYNr)rr#rrErrI)r&r(rs r)rzPairGrid._add_axis_labelssoTYYr1u-t{{; !IB MM%  !TYYq!t_dkk: !IB MM%  !r*c^g}|D]%}t||dk(s|j|'|S)z0Find which variables in a DataFrame are numeric.numeric)r rj)r&rrrs r)rzPairGrid._find_numeric_colss=  )CT#Y'94##C( )r*)r@rArBrCrKr`rrrrrrrrrrrrs@r)rrsl  d4d5d1T%m*^"  0Pd%N5,%%N*%X!r*rcneZdZdZ ddddddddddddddd dZd Zd Zd Zd Zddd d ddddZ ddZ y)rzGrid for drawing a bivariate plot with marginal univariate plots. Many plots can be drawn by using the figure-level interface :func:`jointplot`. Use this class directly when you need more flexibility. N皙?F) r*r+rrratiospacerrhue_normrrrmarginal_ticksc  tj||f}tj|dz|dz}|j|ddddf}|j|dddf|}|j|dddf|}||_||_||_||_tj|jdtj|jdtj|jd dtj|jd d|stj|jjdtj|jjdtj|jjdtj|jjdtj|jdtj|jdtj|jd dtj|jd d|jjd|jjdt!|t#|||  j$j&ddj$j)j+f| rj-fd }|d|_|d|_|d|_dD]7}j4j7|d}|"t9|d|d|9| |j;| | |j=| t#|| | |_tAjB||s.tAjB|d tAjB|d ||fD]:}|j|jfD]}|jDjGd<|jI|jK||y)NrrrYr)r)rF)visibleT)minor)r*r+r)r variablescj|d}|+|jjj|d}|Sr0)rerenamer)rrpr&s r)get_varz#JointGrid.__init__..get_vars;]]3-F!q{{sD'ABMr*r*r+rr^set_r)rrrr)r(bottom)hspacewspace)&rr1GridSpecrr-ax_joint ax_marg_x ax_marg_ysetprrrget_majorticklinesget_minorticklinesrgridrrr&rUranyrr*r+rrrerset_xlimset_ylim _hue_paramsrrrrrOrv)r&rr*r+rrrrrrrrrrrfgsrrrrrnamer#rr&s @@r)rKzJointGrid.__init__s JJ/ 0 \\%!)UQY /==ABG-MM"QV*XM> MM"QRV*XM>    "" **,e< **,e< ***6F ***6F HHY__7795 I HHY__7795 I HHY__7795 I HHY__7795 I HHY..0% @ HHY..0% @ HHY..T.:E J HHY..T.:E J OO  ' OO  ' tta1#/F GKKOOAq{{'8'8':'>'>'@$@A  !((*I  5> .> ? t  * *9 5  .466TVV .v .   *6 * r*c t|jjdxr|jdk( }t |j }|j }|j,|j|d<|j|||jd|vr|jddd|vr ddi}ddi}n d|vrddi}dd i}|r |d |j|jd |n4tj|j||jfi||r |d |j|j d |n4tj|j ||jfi||jj"j%j'd|j j(j%j'd|S) aDraw univariate plots on each marginal axes. Parameters ---------- func : plotting callable If a seaborn function, it should accept ``x`` and ``y`` and plot when only one of them is defined. Otherwise, it must accept a vector of data as the first positional argument and determine its orientation using the ``vertical`` parameter, and it must plot on the "current" axes. If ``hue`` was defined in the class constructor, it must accept ``hue`` as a parameter. kwargs Keyword argument are passed to the plotting function. Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. rdistplotrrlF orientationvertical horizontalT)r*r()r+r(r")rrArr@rrr<rrrr=r*rrr;r+rr get_labelrr)r&r4r' seaborn_funcr orient_kw_x orient_kw_ys r)rzJointGrid.plot_marginals.s,  + +I 6 0MMZ//   o00  88  HHF5M   fd.>.> ? { "   h . K '(*5K(,7K ; &%u-K%t,K   7466dnn 7 7 GGDNN #  1; 1& 1   7466dnn 7 7 GGDNN #  1; 1& 1 &&(44U; &&(44U; r*Trkrl)r*r+jointmarginalr rmc ||d<||d<|>|r|jj|fi||r|jj|fi||>|r|jj|fi||r|jj|fi||S)aJAdd a reference line(s) to joint and/or marginal axes. Parameters ---------- x, y : numeric Value(s) to draw the line(s) at. joint, marginal : bools Whether to add the reference line(s) to the joint/marginal axes. color : :mod:`matplotlib color ` Specifies the color of the reference line(s). linestyle : str Specifies the style of the reference line(s). line_kws : key, value mappings Other keyword arguments are passed to :meth:`matplotlib.axes.Axes.axvline` when ``x`` is not None and :meth:`matplotlib.axes.Axes.axhline` when ``y`` is not None. Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. r rm)rrorrpr)r&r*r+rrr rmrqs r)rrzJointGrid.reflineks6" ) =% %%a484&&&q5H5 =% %%a484&&&q5H5 r*c z|jj|fi||jj|fi||S)aSet axis labels on the bivariate axes. Parameters ---------- xlabel, ylabel : strings Label names for the x and y variables. kwargs : key, value mappings Other keyword arguments are passed to the following functions: - :meth:`matplotlib.axes.Axes.set_xlabel` - :meth:`matplotlib.axes.Axes.set_ylabel` Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. )rrErI)r&xlabelylabelr's r)r8zJointGrid.set_axis_labelss;& !   262    262 r*r0)rr) r@rArBrCrKrrrrrrr8r"r*r)rrshP6 $Dt4d5 P6d)4"H;|4tdd*Xr*raSet up the grid of subplots and store data internally for easy plotting. Parameters ---------- {params.core.data} {params.core.xy} height : number Size of each side of the figure in inches (it will be square). ratio : number Ratio of joint axes height to marginal axes height. space : number Space between the joint and marginal axes dropna : bool If True, remove missing observations before plotting. {{x, y}}lim : pairs of numbers Set axis limits to these values before plotting. marginal_ticks : bool If False, suppress ticks on the count/density axis of the marginal plots. {params.core.hue} Note: unlike in :class:`FacetGrid` or :class:`PairGrid`, the axes-level functions must support ``hue`` to use it in :class:`JointGrid`. {params.core.palette} {params.core.hue_order} {params.core.hue_norm} See Also -------- {seealso.jointplot} {seealso.pairgrid} {seealso.pairplot} Examples -------- .. include:: ../docstrings/JointGrid.rst seealso)rrscatterautorF)rrrrrrkind diag_kindmarkersrrrrplot_kwsdiag_kwsgrid_kwsrVc ddlm}m}||} d}tj|t t |tjstdt||in|j}|in|j}|in|j}|dk(r| |dk(rdnd}n |dk(rdnd}|jd|dk(t|f||||||| | | | d |}| |d k(r]|jd}nt|j}t | t s| g|z} t| |k7r t#d d | i|_n*|d k(r%t | t&r| |d <n| |||d<| |d<|j}|jdd|dk(r|j(|fi|n<|dk(r7|jdd|jdd|j(|fi|| |j*}n |j,}|d k(rddlm}||fi|nP|d k(rddlm}||fi|n;|dk(r"ddlm}|jdd||fi|n|dk(rddlm}||fi|||j7|j9|S)aY Plot pairwise relationships in a dataset. By default, this function will create a grid of Axes such that each numeric variable in ``data`` will by shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots are treated differently: a univariate distribution plot is drawn to show the marginal distribution of the data in each column. It is also possible to show a subset of variables or plot different variables on the rows and columns. This is a high-level interface for :class:`PairGrid` that is intended to make it easy to draw a few common styles. You should use :class:`PairGrid` directly if you need more flexibility. Parameters ---------- data : `pandas.DataFrame` Tidy (long-form) dataframe where each column is a variable and each row is an observation. hue : name of variable in ``data`` Variable in ``data`` to map plot aspects to different colors. hue_order : list of strings Order for the levels of the hue variable in the palette palette : dict or seaborn color palette Set of colors for mapping the ``hue`` variable. If a dict, keys should be values in the ``hue`` variable. vars : list of variable names Variables within ``data`` to use, otherwise use every column with a numeric datatype. {x, y}_vars : lists of variable names Variables within ``data`` to use separately for the rows and columns of the figure; i.e. to make a non-square plot. kind : {'scatter', 'kde', 'hist', 'reg'} Kind of plot to make. diag_kind : {'auto', 'hist', 'kde', None} Kind of plot for the diagonal subplots. If 'auto', choose based on whether or not ``hue`` is used. markers : single matplotlib marker code or list Either the marker to use for all scatterplot points or a list of markers with a length the same as the number of levels in the hue variable so that differently colored points will also have different scatterplot markers. height : scalar Height (in inches) of each facet. aspect : scalar Aspect * height gives the width (in inches) of each facet. corner : bool If True, don't add axes to the upper (off-diagonal) triangle of the grid, making this a "corner" plot. dropna : boolean Drop missing values from the data before plotting. {plot, diag, grid}_kws : dicts Dictionaries of keyword arguments. ``plot_kws`` are passed to the bivariate plotting function, ``diag_kws`` are passed to the univariate plotting function, and ``grid_kws`` are passed to the :class:`PairGrid` constructor. Returns ------- grid : :class:`PairGrid` Returns the underlying :class:`PairGrid` instance for further tweaking. See Also -------- PairGrid : Subplot grid for more flexible plotting of pairwise relationships. JointGrid : Grid for plotting joint and marginal distributions of two variables. Examples -------- .. include:: ../docstrings/pairplot.rst rrzKThe `size` parameter has been renamed to `height`; please update your code.z-'data' must be pandas DataFrame object, not: rkdehistr) rrrrrrrrrrregzSmarkers must be a singleton or a list of markers for each level of the hue variablemarkerrr3rrlFfillT warn_singular scatterplot)regplot)r)r)rrrrr UserWarningrhrr TypeErrortyper<r=rr]rr^rrrrrr` relationalr* regressionr+rrO)rrrrrrrrrrrrrrrr r!rVrrmsgr n_markersplotterr*r+s r)rrsf1 * c;' dBLL );DJ< HJ J%r8==?H%r8==?H%r8==?HF ;!%FI"&&.eI  yF':; D MtF6s'!& MCK MD  5=~~% / gt,")i/7|y( "NOO$g.DL Y '3'%,"$(I!&-#}}H %(F h+(+ e FD)OU3 g**""(( y+ (x( '$8$ *OU3$8$ +%H%   Kr*rrr)r*r+rrrrrrrrr rrrr joint_kws marginal_kwsc  ddlm}ddlm}m}ddlm}m}m}|jddd}tj|td|in|j}|j||in|j}gd }g}|D])}||vs|j||j|+|r?|d k7r:d j!d j#|}tj|tgd }t%d||||dvrd|d}t'|| d} t(j*j,j/| }t1j2dddDcgc]}t5||} }t7| d}!|dk(rd}t9||||| | |||||| | |}"|"j:|j=dd|j?dr|j=d| |"j@|fi||"j:|}#n&|}#|j=dd|j=dd|j=d| |"jB|#fi|n|j?d r|j=d| |"j@|fi||j=d d|j=d| |j}$|j}%d!}&|&D]N}tE|jG|tHs#||\}'}(|$j=||'|%j=||(P|d+|||d"|$d|"jJi|d+|||d#|%d|"jLin|j?d rw|j=d| |j=dd|"j@|fi||j=d| d|vr|j=d|d|"jB|fi|n|j?drtO||"jPd$})tO||"jRd$}*tUt1jV|)|*g}+|j=d%|+|j=d&|!|"j@tXjZfi||j=d d|j=d| |"jB|fi|n|j?d'r]|j=d| |j=d d|"jB|fi||j=d| |"j@|fi|n|j?d(r|j=d| |"j@|fi||"j\j^djajb\}}|j=d| |d+|||"jJd)||d+|||"jLd*|tYjd|"j\|"Scc}w),Nrr))r+ residplot)rr_freedman_diaconis_binsr(z4Ignoring `ax`; jointplot is a figure-level function.rZ) stacklevel)rugfithist_kwsnorm_histhist_kwsrug_kwsr#znThe marginal plotting function has changed to `histplot`, which does not accept the following argument(s): {}.z, )rr$hexr#r%residr)r?r%r@zUse of `hue` with `kind='z'` is not currently supported.C0r )lT)as_cmapr?)rr*r+rrrrrrrrrrrrlFrr r(r'r$)binsbinwidthbinrange)rr*r)rr+r2gridsizecmapr%r@)r*rr()r+rr(r")3r/r*r0r+r7rrrr8rrrr,r<rrjrrdrrrbrcolorConverterto_rgbrlinspacerrrrr=rrrrhrerirrminr*r+rmeanrhexbinr collections get_offsetsTr;),rr*r+rrrrrrrrr rrrrr4r5r'r*r+r7rrr8r1 distplot_keys unused_keysr6 plot_kinds color_rgbr-rrJr marg_func marg_x_kws marg_y_kws pair_keysx_valy_valx_binsy_binsrIs, r)rrs(.II zz$)D c;15 'Y^^-=I V%-2<3D3D3FLMK" ,    s #   S !"tu} D &;' (   c;'CJFJ- 4#::)$/MNo } ))007I:<++aB:O P3nY#. PF P  .D u}  Q!9xfE ^  D xx%0 y!We, 1y1 88  II  # #OU ;  # #FD 1/I66  We,.I.u-/!&&( !&&( 2  2C)--,e4(~ u%%c51%%c51  2 JdaSJJJ4>>JJdaSJJJ4>>J  We,_e4-9-/ Y   # #FIf,= >G4|4  ,TVV4b9,TVV4b9rww/01Z2VT* 0i0u-/H5 5  /t,H5 5We,-9-  !We, /Y/}}((+779;;1/A1#$..ALAA1#$..ALAGGDMM KUQs%XaDraw a plot of two variables with bivariate and univariate graphs. This function provides a convenient interface to the :class:`JointGrid` class, with several canned plot kinds. This is intended to be a fairly lightweight wrapper; if you need more flexibility, you should use :class:`JointGrid` directly. Parameters ---------- {params.core.data} {params.core.xy} {params.core.hue} kind : {{ "scatter" | "kde" | "hist" | "hex" | "reg" | "resid" }} Kind of plot to draw. See the examples for references to the underlying functions. height : numeric Size of the figure (it will be square). ratio : numeric Ratio of joint axes height to marginal axes height. space : numeric Space between the joint and marginal axes dropna : bool If True, remove observations that are missing from ``x`` and ``y``. {{x, y}}lim : pairs of numbers Axis limits to set before plotting. {params.core.color} {params.core.palette} {params.core.hue_order} {params.core.hue_norm} marginal_ticks : bool If False, suppress ticks on the count/density axis of the marginal plots. {{joint, marginal}}_kws : dicts Additional keyword arguments for the plot components. kwargs Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the ``joint_kws`` dictionary. Returns ------- {returns.jointgrid} See Also -------- {seealso.jointgrid} {seealso.pairgrid} {seealso.pairplot} Examples -------- .. include:: ../docstrings/jointplot.rst returns)rr`rr0)7 __future__r itertoolsrinspectrrtextwraprnumpyrpandasrrrbmatplotlib.pyplotpyplotr_baserr r _core.datar _compatr r rrrrrrrpalettesrr _docstringsrr__all__from_nested_components _param_docsr rFrrrrrrrKrCrrr"r*r)rqs-"BB*33 J9!88 H  ?-?-DK9K\             i8 vf /f /Rstsl] ]@ %J F  y ! K Z d d4 fd qu D4d k^ ]Dd ARDt tE ]@5j F  y ! y ! k r*