
    BhV                      S SK Jr  S SKJr  S SKJr  S SKrS SKJr  S SK	r
S SKrS SKrS SKJr  SSKJrJrJr  SSKJr  SS	KJrJr  SS
KJr  SSKJrJrJrJ r J!r!  SSK"J#r#J$r$  SSK%J&r&J'r'  / SQr(\&RR                  " \'S   S9r* " S S5      r+ " S S\+5      r,\-" \" S5      \" S5      \" S5      \" S5      \" S5      \" S5      \" S5      \" S5      \" S5      \" S5      \" S5      S 9r. " S! S"\,5      r/ " S# S$\,5      r0 " S% S&\+5      r1S'Re                  \*\'S(   S)9\1Rf                  l4        SSSSSSS*S+SS,SS-S-SSSSS..S/ jr5 S8SSSS*S0S1S2S-SSSSSSS-SSS3.S4 jjr6S5Re                  \*\'S6   \'S(   S79\6l4        g)9    )annotations)product)	signatureN)dedent   )VectorPlottervariable_typecategorical_order)handle_data_source)
share_axisget_legend_handles)utils)adjust_legend_subtitlesset_hls_values_check_argument_draw_figure_disable_autolayout)color_paletteblend_palette)DocstringComponents
_core_docs)	FacetGridPairGrid	JointGridpairplot	jointplotparams)corec                  P    \ rS rSrSrS r\S 5       r\S 5       rS r	S r
S rS	rg
)	_BaseGrid%   z!Base class for grids of subplots.c                n    U R                   R                   H  nUc  M  UR                  " S0 UD6  M     U $ )z$Set attributes on each subplot Axes. )axesflatset)selfkwargsaxs      cC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\seaborn/axisgrid.pyr&   _BaseGrid.set(   s/    ))..B~   !     c                    U R                   $ )z)DEPRECATED: prefer the `figure` property._figurer'   s    r*   fig_BaseGrid.fig/   s     ||r,   c                    U R                   $ )zHAccess the :class:`matplotlib.figure.Figure` object underlying the grid.r.   r0   s    r*   figure_BaseGrid.figure8   s     ||r,   c                    U" U /UQ70 UD6  U $ )a@  
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'   funcargsr(   s       r*   apply_BaseGrid.apply=   s     	T#D#F#r,   c                    U" U /UQ70 UD6$ )aO  
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#   r7   s       r*   pipe_BaseGrid.pipeL   s     D*4*6**r,   c                    UR                  5       nUR                  SS5        U R                  R                  " U0 UD6  g)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_inchestightN)copy
setdefaultr4   savefigr'   r9   r(   s      r*   rD   _BaseGrid.savefigZ   s6     -1T,V,r,   r#   N)__name__
__module____qualname____firstlineno____doc__r&   propertyr1   r4   r:   r=   rD   __static_attributes__r#   r,   r*   r    r    %   sA    +    +
-r,   r    c                  `    \ rS rSrSrSrSrS rS r  SS jr	S	 r
S
 r\S 5       rSS jrSrg)Gridg   z>A grid that can have multiple subplots and an external legend.FTc                2    / SQU l         S U l        SU l        g )N)r   r   r   r   F)_tight_layout_rect_tight_layout_pad_extract_legend_handlesr0   s    r*   __init__Grid.__init__l   s    ".!% (-$r,   c                    UR                  5       nUR                  SU R                  5        U R                  b  UR                  SU R                  5        U R                  R
                  " U0 UD6  U $ )z:Call fig.tight_layout within rect that exclude the legend.rectpad)rB   rC   rR   rS   r/   tight_layoutrE   s      r*   rZ   Grid.tight_layoutu   sa    &$"9"9:!!-eT%;%;<!!4262r,   Nc                P   Uc  U R                   nUcT  U R                  c  [        UR                  5       5      nO-[        [	        [
        R                  U R                  5      5      n[        R                  R                  SSS9nU Vs/ s H  oqR                  Xv5      PM     nnUc  U R                  OUn[        R                  S   n	/ n
U H0  n[        U[        5      (       a  Uu  pOUnU
R                  U5        M2     UR!                  SS5        U R"                  (       Ga  UR!                  SS5        UR!                  SS	5        U R$                  R&                  " X40 UD6nXl        UR+                  US
U	0S9  U(       a  [-        U5        [/        U R$                  5        UR1                  5       R2                  U R$                  R4                  -  nU R$                  R7                  5       u  nnU R$                  R9                  UU-   U5        [/        U R$                  5        UR1                  5       R2                  U R$                  R4                  -  nUUU-   -  nU R:                  (       a  SOSnUU-   U l        SU R<                  -
  nU R$                  R?                  US9  UU R@                  S'   U $ U RB                  RD                  S   nUR!                  SS5        UR&                  " X40 UD6nUR+                  US
U	0S9  UU l        U(       a  [-        U5        U $ s  snf )ac  Draw 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	linewidthzlegend.title_fontsizescatterpointsr   frameonFloczcenter rightsize)propg{Gz?{Gz?)right   best)#_legend_data	hue_nameslistkeysmapr   to_utf8mplpatchesPatchget_hue_varrcParams
isinstancetupleappendrC   _legend_outr/   legend_legend	set_titler   r   get_window_extentwidthdpiget_size_inchesset_size_inches_margin_titles_space_neededsubplots_adjustrR   r$   r%   )r'   legend_datatitlelabel_orderadjust_subtitlesr(   blank_handlelabhandles
title_sizelabelsentry_label	figlegendlegend_width	fig_width
fig_heightspace_neededmarginre   r)   legs                          r*   
add_legendGrid.add_legend~   s   : ++K~~%";#3#3#56"3u}}dnn#EF{{((qA(>ALM#??35M!&E\\"9:
  E%'' 5MM%  ! 	/1-i/e^4 ++GFvFI$LVZ,@A'	2 & %668>>AQAQQL$(LL$@$@$B!IzLL((\)A:N & %668>>AQAQQL'9|+CDL //SSF!',!6D***E LL((u(5).D##A&  "BeV,))G6v6CMM%vz&:M;DL',A Ns   	L#c                   0 nUR                   b  U R                  (       aw  [        UR                   5      nUR                   R                   Vs/ s H  oDR	                  5       PM     nnUR                  [        X55       VVs0 s H  u  pgXv_M	     snn5        UR                  5       u  p5UR                  [        X55       VVs0 s H  u  pgXv_M	     snn5        U R                  R                  U5        SUl         gs  snf s  snnf s  snnf )z8Extract the legend data from an axes object and save it.N)	legend_rT   r   textsget_textupdatezipget_legend_handles_labelsrh   )r'   r)   datar   tr   handler   s           r*   _update_legend_dataGrid._update_legend_data   s     ::!d&B&B(4G,.JJ,<,<=,<qjjl,<F=KKC<PQ<P=6<PQR668G8LM8L}vU]8LMN  & 
 >Q Ns   C<D
D
c                p   Uc  [        SS9nU$ [        X   U5      n[        U5      nUc;  [        R                  " 5       nU[        U5      :  a  [        SU5      nOJ[        US9nO@[        U[        5      (       a   U V	s/ s H  oU	   PM	     n
n	[        X5      nO[        XF5      n[        X5      nU$ s  sn	f )z*Get a list of colors for the hue variable.r   )n_colorshusl)r   r
   lenr   get_color_cyclert   dict)r'   r   hue	hue_orderpaletteri   r   current_palettecolorshcolor_namess              r*   _get_paletteGrid._get_palette   s    ;#Q/G2 - *$)Y?I9~H "'"7"7"9c/22*68<F*H=F GT**3<=9aqz9=&{= 'w9#F5G >s   ?B3c                <     U R                   $ ! [         a     gf = f)z9The :class:`matplotlib.legend.Legend` object, if present.N)ry   AttributeErrorr0   s    r*   rx   Grid.legend  s#    	<< 		s    
c                h    U R                   R                   H  nUR                  " SSU0UD6  M     U $ )aN  Modify 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#   )r4   r$   tick_params)r'   r   r(   r)   s       r*   r   Grid.tick_params  s1    " ++""BNN/// #r,   )rT   ry   r   rS   rR   )NNNF)both)rG   rH   rI   rJ   rK   r   rw   rU   rZ   r   r   r   rL   rx   r   rM   r#   r,   r*   rO   rO   g   sM    HNK- DH$)fP&<  r,   rO   z    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`.
    )r   rowcolrowcol_ordercol_wrapshare_xyheightaspectr   
legend_outmargin_titles	facet_kwsc                    ^  \ rS rSrSrSSSSSSSSSSSSSSSSSSSSSS.U 4S	 jjr\" S
5      R                  " S&0 \D6\l        S r	S r
S rS rS rS rS'S jrS rS(S jrS)S jrS)S jrS*S jrS+S jrS,S jrSSSSS.S jr\S 5       r\S 5       r\S 5       r\S  5       r\S! 5       r\S" 5       r\S# 5       r\S$ 5       r S%r!U =r"$ )-r   ip  z7Multi-plot grid for plotting conditional relationships.NT   r   F)rowcolr   r   sharexshareyr   r   r   	row_order	col_orderr   hue_kwsdropnar   despiner   xlimylimsubplot_kwsgridspec_kwsc               
  > [         T.U ]  5         [        U5      nUnUc  S nO[        X   U5      nU R	                  XX5      nUc  / nO[        X   U5      nUc  / nO[        X   U5      nUb  UO0 n[
        R                  " [        U5      [        5      nU(       aO  Uc  UOX   R                  5       nUc  UOX   R                  5       nUc  UOX   R                  5       nUU-  U-  ) n OU) n Uc  SO
[        U5      n!Uc  SO
[        U5      n"U!U"-  U l
        XPl        Ub=  Ub  Sn#[        U#5      eUn![        [
        R                  " [        U5      U-  5      5      n"U!U l        U"U l        U!U-  U	-  U"U-  4n$Ub  SnUc  0 OUR#                  5       nUc  0 OUR#                  5       nUb  UUS'   Ub  UUS'   [%        5          [&        R(                  " U$S9n%S S S 5        Uc  [+        SXgUUS9n&W%R,                  " U"U!40 U&D6n'Uc  Uc  0 n(GO/Uc!  [+        [/        UU'R0                  5      5      n(GOUc   [+        [/        UU'R0                  5      5      n(O[3        UU5      n)[+        [/        U)U'R0                  5      5      n(OU(       a  [4        R6                  " S5        [        U5      n*[
        R8                  " U*[:        5      n'W%R<                  " U"U!S40 UD6U'S	'   U(       a  U'S	   US
'   U(       a  U'S	   US'   [?        SU*5       H  n+U%R<                  " U"U!U+S-   40 UD6U'U+'   M      [+        [/        UU'5      5      n(U%U l         U'U l!        U(U l"        S U l#        Xl$        UU l%        UU l&        UU l'        Xl(        U"U l        X l)        U!U l        X0l*        UU l+        / U l,        XPl        UU l-        UU l.        UU l/        0 U l0        S U l1        S U l2        X`l3        Xpl4        Xl5        U U l6        U Ro                  5         U Rq                  5         U(       a  U Rs                  5         US;   a  U Rt                   Hu  n,U,Rw                  5        H  n-U-Ry                  S5        M     U,Rz                  R|                  Ry                  S5        U,Rz                  R~                  Ry                  S5        Mw     US;   a  U R                   Hu  n,U,R                  5        H  n-U-Ry                  S5        M     U,R                  R|                  Ry                  S5        U,R                  R~                  Ry                  S5        Mw     g g ! , (       d  f       GNh= f)Nr   z)Cannot use `row` and `col_wrap` together.Fr   r   figsize)squeezer   r   
subplot_kwgridspec_kwz,`gridspec_kws` ignored when using `col_wrap`r   r   r   )Tr   )Tr   )CsuperrU   r   r
   r   npzerosr   boolisnull	_n_facets	_col_wrap
ValueErrorintceil_ncol_nrowrB   r   pltr4   r   subplotsr   r%   r   warningswarnemptyobjectadd_subplotranger/   _axes
_axes_dictry   r   	row_names	col_namesri   r   _row_var_col_varr   _margin_titles_textsrr   _colorsrw   rh   _x_var_y_var_sharex_sharey_dropna_not_na
set_titlesrZ   r   _not_bottom_axesget_xticklabelsset_visiblexaxis
offsetTextr   _not_left_axesget_yticklabelsyaxis)/r'   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   hue_varri   r   r   r   none_narow_nacol_nahue_nanot_nancolnrowerrr   r1   r(   r$   	axes_dictfacet_productn_axesir)   r   	__class__s/                                                 r*   rU   FacetGrid.__init__s  s    	!$' ;I)$)Y?I""4iA ;I)$)Y?I;I)$)Y?I %0'b ((3t9d+ #W1A1A1CF #W1A1A1CF #W1A1A1CF/0FXF KqS^KqS^!A o%Drwws9~89:D


 &=6)4&=9 !M (/b[5E5E5G)1r|7H7H7J"&K"&K !"**W-C # %!'%0&24F
 <<d5f5D{s{	 Y		!:;	 Y		!:;	 '	9 = ]DII!>?	
 LM^F88FF+DoodD!C{CDG(,QH%(,QH%1f%//$a!eK{KQ & SD12I 
# 	""" 

+$&!!% 	LLN]"++//1E%%e, 2##//6**51	 , ]"))//1E%%e, 2##//6**51	 * #y #"s   T99
Ua?          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 <grid_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              #  b  #    U R                   nU R                  (       a,  U R                   Vs/ s H  o!U R                     U:H  PM     nnO+[        R                  " S[        U R                   5      5      /nU R                  (       a,  U R                   Vs/ s H  o!U R                     U:H  PM     nnO+[        R                  " S[        U R                   5      5      /nU R                  (       a,  U R                   Vs/ s H  o!U R                     U:H  PM     nnO+[        R                  " S[        U R                   5      5      /n[        [        U5      [        U5      [        U5      5       H,  u  u  pgu  pu  pXU	-  U-  U R                  -     nXhU
4U4v   M.     gs  snf s  snf s  snf 7f)a  Generator 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)r   r   r   r   repeatr   r   r   ri   rr   r   	enumerater   )r'   r   n	row_masks	col_masks	hue_masksr  r   jr   kr   data_ijks                r*   
facet_dataFacetGrid.facet_data  sa     yy >>;?>>J>admm,1>IJI4TYY89I >>;?>>J>admm,1>IJI4TYY89I >>;?>>J>admm,1>IJI4TYY89I -4Ii4H4=i4H4=i4H-J(HQhq #IOdll:;H)X%%	-J# K K Ks+   ,F/F 	AF/F%1AF/>F*BF/c                r   UR                  SS5      n[        [        USS5      5      nUS:X  a}  SU;  a1  SR                  UR                  5      n[
        R                  " U5        [        U5      S:X  a7  S	U;  a1  S
R                  UR                  5      n[
        R                  " U5        U R                  5        GHW  u  u  pxpU
R                  R                  (       d  M&  UR                  S5      (       + nU R                  XxU5      nU R                  X5      US'   U R                  R                  5        H  u  pX   X='   M     U R                   b&  ["        R$                  " U R&                  U	   5      US'   U
[)        U5         nU R*                  (       a  UR-                  5       nUR                  5        VVs/ s H  u  nnUPM
     nnnUR                  S5      (       a  U Vs/ s H  nUR                  PM     nnU R/                  XUU5        GMZ     U R1                  USS 5        U $ s  snnf s  snf )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.

colorNrH    zseaborn.categoricalorderzXUsing the {} function without specifying `order` is likely to produce an incorrect plot.r   r   z\Using the {} function without specifying `hue_order` is likely to produce an incorrect plot.seabornr   
matplotlibrf   )popstrgetattrformatrG   r   r   r   r  valuesrb   
startswith
facet_axis_facet_colorr   itemsrr   r   rm   ri   rj   r   r   _facet_plot_finalize_grid)r'   r8   r9   r(   kw_colorfunc_modulewarningrow_icol_jhue_kr  modify_stater)   kwval_list	plot_datar  v	plot_argss                      r*   rl   FacetGrid.map  s   0 ::gt, '$b9: //f$##)6$--#8  g&4yA~+V";##)6$--#8  g& 04/@+!U5 ??''  +55i@@L|<B #//@F7O !% 2 2 4%_
 !5 }}("'--u0E"Fw !d,I||%,,.	'0'89'8tq!'8I9 %%l33/89y!QXXy	9 Ty&9A 0AF 	D!H% : :s   <H.(H4c                   UR                  SS5      nU R                  5        H  u  u  pVpxUR                  R                  (       d  M%  [	        UR
                  5      R                  S5      (       + n	U R                  XVU	5      n
U R                  Xt5      US'   U R                  R                  5        H  u  pX   X;'   M     U R                  b  U R                  U   US'   U R                  (       a  UR                  5       nXS'   U R                  XX#5        M     UR!                  SS5      UR!                  SS5      /n[#        USS 5       H	  u  pXU'   M     U R%                  U5        U $ )	a  Like ``.map`` but passes args as strings and inserts data in kwargs.

This method is suitable for plotting with functions that accept a
long-form DataFrame as a `data` keyword argument and access the
data in that DataFrame using string variable names.

Parameters
----------
func : callable
    A plotting function that takes data and keyword arguments. Unlike
    the `map` method, a function used here must "understand" Pandas
    objects. It also 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.

r   Nr#  r   r   xyrf   )r%  r  r)  rb   r&  rH   r*  r+  r,  r   r-  rr   ri   r   r   r.  rq   r  r/  )r'   r8   r9   r(   r0  r3  r4  r5  r  r6  r)   r7  r8  axis_labelsr  vals                   r*   map_dataframeFacetGrid.map_dataframe  sI   < ::gt, 04/@+!U5 ??''  #4??3>>yIIL|<B #//@F7O !% 2 2 4%_
 !5 }}("&.."7w ||#??,%6N Tt47 0A> zz#t,fjjd.CDRa)FA N *K(r,   c                6    U R                   U   nUb  U$ Ub  U$ g N)r   )r'   	hue_indexr0  r   s       r*   r,  FacetGrid._facet_colorD  s+    Y'OL r,   c                    [        UR                  5      R                  S5      (       a2  UR                  5       n/ SQn[	        XS5       H	  u  pgXtU'   M     / nX$S'   U" U0 UD6  U R                  U5        g )Nr#  )r>  r?  r   rb   styler)   )r&  rH   r*  rB   r   r   )r'   r8   r)   r;  plot_kwargs	semanticskeyrA  s           r*   r.  FacetGrid._facet_plotL  st     t**955%**,K:I	5#&C  6I "i';' 	  $r,   c                B    U R                   " U6   U R                  5         g)z$Finalize the annotations and layout.N)set_axis_labelsrZ   )r'   axlabelss     r*   r/  FacetGrid._finalize_grid[  s    h'r,   c                    U R                   b  U R                  R                  U   nOU R                  X4   nU(       a  [        R                  " U5        U$ )z?Make the axis identified by these indices active and return it.)r   r$   r%   r   sca)r'   r3  r4  r6  r)   s        r*   r+  FacetGrid.facet_axis`  sE     >>%&B5<(B GGBK	r,   c                H    [         R                  " U R                  40 UD6  U $ )z#Remove axis spines from the facets.)r   r   r/   )r'   r(   s     r*   r   FacetGrid.despinen  s    dll-f-r,   c                ~    Ub  Xl         U R                  " U4SU0UD6  Ub  X l        U R                  " U4SU0UD6  U $ )z>Set axis labels on the left column and bottom row of the grid.clear_inner)r   set_xlabelsr   set_ylabels)r'   x_vary_varrX  r(   s        r*   rO  FacetGrid.set_axis_labelss  sM    KUFFvFKUFFvFr,   c                    Uc  U R                   nU R                   H  nUR                  " U40 UD6  M     U(       a$  U R                   H  nUR                  S5        M     U $ )z/Label the x axis on the bottom row of the grid.r!  )r   _bottom_axes
set_xlabelr   r'   r   rX  r(   r)   s        r*   rY  FacetGrid.set_xlabels~  sU    =KKE##BMM%*6* $++b! ,r,   c                    Uc  U R                   nU R                   H  nUR                  " U40 UD6  M     U(       a$  U R                   H  nUR                  S5        M     U $ )z0Label the y axis on the left column of the grid.r!  )r   
_left_axes
set_ylabelr  ra  s        r*   rZ  FacetGrid.set_ylabels  sS    =KKE//BMM%*6* "))b! *r,   c                   U R                   R                   H  nUR                  5       nUR                  U5        Uct  UR	                  5        Vs/ s H  ofR                  5       PM     nnUb/  UR                  5       SSU2   nUSSU2   nUR                  U5        UR                  " U40 UD6  M  UR                  " U40 UD6  M     U $ s  snf )z#Set x axis tick labels of the grid.N)r$   r%   
get_xticks
set_xticksr   r   set_xticklabels)	r'   r   stepr(   r)   
curr_ticksr   curr_labelsxtickss	            r*   rj  FacetGrid.set_xticklabels  s    ))..BJMM*%~=?=O=O=QR=QE~~/=QR#]]_VtV4F"-ff"5KMM&)"";9&9""64V4 !  Ss   Cc                <   U R                   R                   H|  nUR                  5       nUR                  U5        UcB  UR	                  5        Vs/ s H  oUR                  5       PM     nnUR                  " U40 UD6  Mi  UR                  " U40 UD6  M~     U $ s  snf )z6Set y axis tick labels on the left column of the grid.)r$   r%   
get_yticks
set_yticksr  r   set_yticklabels)r'   r   r(   r)   rl  r   rm  s          r*   rs  FacetGrid.set_yticklabels  s    ))..BJMM*%~=?=O=O=QR=QE~~/=QR"";9&9""64V4 ! 	 Ss   Bc           
        [        U R                  U R                  S9nUR                  S[        R
                  S   5      US'   Uc  SnUc  SnUc2  U R                  c  UnO"U R                  c  UnOSR                  X#/5      n[        R                  " U5      n[        R                  " U5      n[        R                  " U5      nU R                  (       Ga=  U R                   H  nUR                  5         M     / U l
        U R                  b  [        U R                  5       Ht  u  pxU R                  US4   n	UR                  [        US95        UR                   " S0 UD6n
U	R"                  " U
4S	S
SSSS.UD6nU R                  R%                  U5        Mv     U R&                  bj  [        U R&                  5       HQ  u  pUR                  [        US95        UR                   " S0 UD6n
U R                  SU4   R(                  " U
40 UD6  MS     U $ U R                  b  U R                  b  [        U R                  5       Hn  u  px[        U R&                  5       HP  u  pUR                  [        XS95        UR                   " S0 UD6n
U R                  X{4   R(                  " U
40 UD6  MR     Mp     U $ U R                  b  [+        U R                  5      (       al  [        U R                  5       HQ  u  pxUR                  [        US95        UR                   " S0 UD6n
U R                  US4   R(                  " U
40 UD6  MS     U $ U R&                  b  [+        U R&                  5      (       ar  [        U R&                  5       HY  u  p|UR                  [        US95        UR                   " S0 UD6n
U R                  R,                  U   R(                  " U
40 UD6  M[     U $ )a  Draw 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_varcol_varrb   zaxes.labelsizez{row_var} = {row_name}z{col_var} = {col_name}z | )row_name)gRQ?      ?zaxes fractioni  leftcenter)xyxycoordsrotationhava)col_namer   )ry  r  r#   )r   r   r   r%  rn   rs   joinr   rm   r   r   remover   r  r$   r   r(  annotaterv   r   rz   r   r%   )r'   templaterow_templatecol_templater(   r9   textr  ry  r)   r   r  r  s                r*   r   FacetGrid.set_titles  sR   , DMM4==AFCLL9I,JKv 3L3L}}$'&' ::|&BC}}\2}}\2==* 11 2(*D%~~)#,T^^#<KA1b5)BKKh 78(//7$7E;;",!$H !D
 --44T: $= ~~)#,T^^#<KAKKh 78(//7$7EIIadO--e>v> $=
 K MM%DMM,E(8#,T^^#<KAKKh JK$OO3d3EIIadO--e>v> $=  9   ^^'C,?,?(8D(34 /$/		!Q$))%:6:  9  ^^'C,?,?(8D(34 /$/		q!++E<V<	  9
 r,   .5--)r>  r?  r   	linestylec                   X5S'   XES'   Ub#  U R                   " [        R                  4SU0UD6  Ub#  U R                   " [        R                  4SU0UD6  U $ )au  Add a reference line(s) to each facet.

Parameters
----------
x, y : numeric
    Value(s) to draw the line(s) at.
color : :mod:`matplotlib color <matplotlib.colors>`
    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   r  r>  r?  )rl   r   axvlineaxhline)r'   r>  r?  r   r  line_kwss         r*   reflineFacetGrid.refline  sW    . " )=HHS[[2A22=HHS[[2A22r,   c                    U R                   $ )zBAn array of the :class:`matplotlib.axes.Axes` objects in the grid.)r   r0   s    r*   r$   FacetGrid.axes/  s     zzr,   c                n    U R                   R                  S:X  a  U R                   S   $ Sn[        U5      e)zJThe :class:`matplotlib.axes.Axes` when no faceting variables are assigned.)r   r   )r   r   z<Use the `.axes` attribute when facet variables are assigned.)r$   shaper   )r'   r  s     r*   r)   FacetGrid.ax4  s:     99??f$99T?" O  !%%r,   c                    U R                   $ )a  A mapping of facet names to corresponding :class:`matplotlib.axes.Axes`.

If only one of ``row`` or ``col`` is assigned, each key is a string
representing a level of that variable. If both facet dimensions are
assigned, each key is a ``({row_level}, {col_level})`` tuple.

)r   r0   s    r*   r  FacetGrid.axes_dict?  s     r,   c                   U R                   c  U R                  SS2SS24   R                  $ / nU R                  U R                  -  U R
                  -
  n[        U R                  5       Hz  u  p4X0R                  -  =(       aF    X0R                  U R                  S-
  -  :  =(       a!    X0R                  U R                  S-
  -  U-
  :  nU(       d  Mi  UR                  U5        M|     [        R                  " U[        5      R                  $ )z&Return a flat array of the inner axes.Nrx  r   r   r$   r%   r   r   r   r  rv   r   arrayr   r'   r$   n_emptyr  r)   rv   s         r*   _inner_axesFacetGrid._inner_axesL  s     >>!99SbS!"W%***Djj4::->G"499-

N FZZ4::>:;FZZ4::>:WDE 
 6KKO . 88D&)...r,   c                ,   U R                   c  U R                  SS2S4   R                  $ / n[        U R                  5       H+  u  p#X R                  -  (       a  M  UR                  U5        M-     [        R                  " U[        5      R                  $ )z/Return a flat array of the left column of axes.Nr   	r   r$   r%   r  r   rv   r   r  r   r'   r$   r  r)   s       r*   rd  FacetGrid._left_axes^  so     >>!99QT?'''D"499-::~~KKO . 88D&)...r,   c                0   U R                   c  U R                  SS2SS24   R                  $ / n[        U R                  5       H+  u  p#X R                  -  (       d  M  UR                  U5        M-     [        R                  " U[        5      R                  $ )z;Return a flat array of axes that aren't on the left column.Nr   r  r  s       r*   r  FacetGrid._not_left_axesj  sr     >>!99QU#(((D"499-zz>>KKO . 88D&)...r,   c                   U R                   c  U R                  SSS24   R                  $ / nU R                  U R                  -  U R
                  -
  n[        U R                  5       He  u  p4X0R                  U R                  S-
  -  :  =(       d!    X0R                  U R                  S-
  -  U-
  :  nU(       d  MT  UR                  U5        Mg     [        R                  " U[        5      R                  $ )z.Return a flat array of the bottom row of axes.Nrx  r   r  r  s         r*   r_  FacetGrid._bottom_axesv  s     >>!99RU#(((Djj4::->G"499-**

Q78 FZZ4::>:WDE  6KKO . 88D&)...r,   c                   U R                   c  U R                  SS2SS24   R                  $ / nU R                  U R                  -  U R
                  -
  n[        U R                  5       He  u  p4X0R                  U R                  S-
  -  :  =(       a!    X0R                  U R                  S-
  -  U-
  :  nU(       d  MT  UR                  U5        Mg     [        R                  " U[        5      R                  $ )z:Return a flat array of axes that aren't on the bottom row.Nrx  r   r  r  s         r*   r   FacetGrid._not_bottom_axes  s     >>!99SbS!V$)))Djj4::->G"499-tzzA~67 FZZ4::>:WDE  6KKO . 88D&)...r,   )r   r   r   r   r   r   r/   rr   ry   rh   rw   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ri   r   r#   )T)NNT)NT)NNrE  )NNN)#rG   rH   rI   rJ   rK   rU   r   r(  _facet_docsr  rl   rB  r,  r.  r/  r+  r   rO  rY  rZ  rj  rs  r   r  rL   r$   r)   r  r  rd  r  r_  r   rM   __classcell__r  s   @r*   r   r   p  s|   A dtD1d$$t$Ttr2 r2h  Z Zt VuZ Z#t "uZ#Hx&&PPdEN%

			 
Yv  4tt  H   & &   / /" 	/ 	/ 	/ 	/ / /  / /r,   r   c                     ^  \ rS rSrSrSSSSSSSSSSSSSSS	.U 4S
 jjrS rS rS rS r	S r
S rS rS rS rS rS rSrU =r$ )r   i  a)  Subplot 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 <grid_tutorial>` for more information.

NFT      @r   rz  )r   varsx_varsy_varsr   r   r   cornerdiag_shareyr   r   
layout_padr   r   c                 > [         TU ]  5         [        U5      nU R                  U5      nUU;   a  UR	                  U5        Ub  [        U5      n[        U5      nUc  UnUc  Un[        R                  " U5      (       a  U/n[        R                  " U5      (       a  U/n[        U5      =U l        n[        U5      =U l	        nU R                  U R                  :H  U l
        U(       d  [        S5      eU(       d  [        S5      e[        U5      U-  U-  [        U5      U-  4n[        5          [        R                  " US9nSSS5        WR!                  [        U5      [        U5      SSSS9nXl        U	(       aE  [        R$                  " US	5      n['        U6  H"  u  nnUUU4   R	                  5         SUUU4'   M$     UU l        UU l        Xl        Xl        SU l        SU l        Xl        U R7                  5         X l        Uc<  S
/=U l        n[<        R>                  " S
/[        U5      -  UR@                  S9U l!        OJ[E        X   U5      =nnU(       a#  [        [G        [<        RH                  U5      5      nUU l        X   U l!        Ub  UO0 U l%        Xpl&        X`l'        U RQ                  XXg5      U l)        0 U l*        USS2SS24   RV                   Hz  nUc  M  URY                  5        H  nUR[                  S5        M     UR\                  R^                  R[                  S5        UR\                  R`                  R[                  S5        M|     USS2S	S24   RV                   Hz  nUc  M  URc                  5        H  nUR[                  S5        M     URd                  R^                  R[                  S5        URd                  R`                  R[                  S5        M|     / SQU l3        Xl4        Xl5        U(       a  [l        Rn                  " US9  U Rq                  US9  g! , (       d  f       GN= f)a  Initialize 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.r   r   r   F)r   r   r   r   
_nolegend_)indexrx  )rd   rd   Gz?r  )r1   )rY   )9r   rU   r   _find_numeric_colsr  rj   r   isscalarr  r  square_gridr   r   r   r   r4   r   _cornertriu_indices_fromr   r/   r$   r   r  	diag_vars	diag_axesr   _add_axis_labelsrr   ri   pdSeriesr  hue_valsr
   filternotnullr   _orig_palette
_hue_orderr   r   rh   r%   r   r   r   r   r   r  r  rR   rS   _despiner   r   rZ   )r'   r   r   r  r  r  r   r   r   r  r  r   r   r  r   r   numeric_colsr   r1   r$   hide_indicesr  r  ri   r)   r   r  s                             r*   rU   PairGrid.__init__  s   p 	!$' ..t4,$$ZF$ZF>!F>!F;;vXF;;vXF#F|+f#F|+f;;$++5CDD@AA f+&/Vv1EE "**W-C # ||CKV#($)  + //a8L\*1QT
!!#!QT
 + 		 ' 	 ;*67DNYII|ns4y&@,0JJ8DM %6di$KKI	 

I!>?	&DN IDM #*"5w2$#((IG ssAv,##Bz++-!!%( .HH++E2HHNN&&u- $ q!"u+""Bz++-!!%( .HH++E2HHNN&&u- # #7!+MMc"j)k #"s   1P..
P=c                    [         R                  " U R                  R                  5      u  p4[	        UR
                  UR
                  5      nU R                  " X40 UD6  U $ )a  Plot 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``.

)r   indicesr$   r  r   r%   _map_bivariate)r'   r8   r(   row_indicescol_indicesr  s         r*   rl   PairGrid.mapV  sM     $&::diioo#> k&&(8(89D4V4r,   c                z    [        [        R                  " U R                  S5      6 nU R                  " X40 UD6  U $ )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``.

rx  )r   r   tril_indices_fromr$   r  r'   r8   r(   r  s       r*   	map_lowerPairGrid.map_lowerg  s7     r++DIIr:;D4V4r,   c                z    [        [        R                  " U R                  S5      6 nU R                  " X40 UD6  U $ )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   )r   r   r  r$   r  r  s       r*   	map_upperPairGrid.map_upperv  s7     r++DIIq9:D4V4r,   c                n   U R                   (       a9  U R                  " U40 UD6  U R                  (       d  U R                  " U40 UD6  U $ / n[	        U R
                  5       H<  u  pE[	        U R                  5       H  u  pgXu:w  d  M  UR                  XF45        M      M>     U R                  " X40 UD6  U $ )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``.

)	r  r  r  r  r  r  r  rv   r  )r'   r8   r(   r  r  r\  r  r[  s           r*   map_offdiagPairGrid.map_offdiag  s     NN4*6*<<t.v.  G'4
"+DKK"8JA~v. #9 5 88r,   c                f   U R                   Gc  / n/ n[        U R                  5       GH2  u  pV[        U R                  5       GH  u  pxX:X  d  M  UR	                  U5        U R
                  XW4   n	U	R                  5       n
U
R                  5         UR	                  U
5        [        R                  R                  SS5      (       d8  U	R                  R                   H  nUR                  R                  S5        M      U R                  (       d  M  U	R                  R                  S5        U R                   (       d  M  ["        R$                  " U	SS9  GM     GM5     U R&                  (       a#  U(       a  USS  H  n	[)        US   U	S5        M     X0l        X@l         S	[-        U5      R.                  ;  a  U R0                  " U40 UD6$ [3        U R*                  U R                   5       GH1  u  pUR5                  5       n[7        UR8                  5      R;                  S
5      (       a  XS'   O[        R<                  " U	5        U R>                  U   nU R@                  b  U R>                  U R@                     nOSnU RB                  (       a3  URE                  5       nUb  UURE                  5       -  nUU   nUb  UU   nURG                  S	U5        URG                  SU RH                  5        URG                  SU RJ                  5        U" SSU0UD6  SU	l&        GM4     U RO                  5         U $ )a!  Plot 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.leftTFr)   r{  r   r   r?  r   r#  r)   r   r   r>  r#   )(r  r  r  r  rv   r$   twinxset_axis_offr   rs   rq   r  
majorTicks	tick1liner   r  r  r   r   r  r   r  r   
parameters_map_diag_iter_huer   rB   r&  rH   r*  rS  r   rr   r   notnarC   r  r  r   r  )r'   r8   r(   r  r  r  r\  r  r[  r)   diag_axtickvarrJ  vectorr   r	  s                    r*   map_diagPairGrid.map_diag  s    >>!II%dkk2 )$++ 6HA~ "((/!YYqt_"$((*,,.!((1  #||//dCC(*(;(; $ : :5 A )<  <<<HH007#}}} %$ ?) !7 32 I#AB-By|R5 ( 'N&N	$222**4:6:: 4>>4>>:GC ++-K4??#..y99$&D!YYs^F}}(ii.||?ciik)F?f+C""5#."";@""9d.@.@A)6)[)BJ5 ;8 	r,   c           	     B   UR                  SS5      n[        U R                  U R                  5       GH.  u  pEU R                  U   R                  U R                  SS9nUR                  5       n[        UR                  5      R                  S5      (       a  XWS'   O[        R                  " U5        [        U R                  5       H  u  p UR                  U	5      n
Uc  U R(                  U   nOUnU R*                  (       a  [,        R.                  " U
5      n
[        UR                  5      R                  S5      (       a  U" S
XUS.UD6  M  U" U
4XS	.UD6  M     GM1     U R1                  5         U $ ! [          a    ["        R$                  " / [&        S9n
 Nf = f)z<Put marginal plot on each diagonal axes, iterating over hue.r   NTobservedr#  r)   )dtype)r>  r   r   )r   r   r#   )r%  r   r  r  r   groupbyr  rB   r&  rH   r*  r   rS  r  r  	get_groupKeyErrorr  r  floatr   r   r   	remove_nar  )r'   r8   r(   fixed_colorr  r)   hue_groupedrJ  r  label_kdata_kr   s               r*   r  PairGrid._map_diag_iter_hue  sS    jj$/4>>4>>:GC))C.000NK ++-K4??#..y99$&D!'8
8(227;F & LLOE'E<<"__V4Ft'229==M6MMKwK{K' 9 ;< 	%   8YYr7F8s   E88#FFc                ~   SSK JnJn  XL d  XL a  SU l        UR	                  5       nU HL  u  pxU R
                  U   n	U R                  U   n
U R                  Xx4   nUc  M8  U R                  " XX40 UD6  MN     U R                  5         S[        U5      R                  ;   a  [        U R                  5      U l        gg)z,Draw a bivariate plot on the indicated axes.r   histplotkdeplotTNr   )distributionsr  r  rT   rB   r  r  r$   _plot_bivariater  r   r  rj   rh   ri   )r'   r8   r  r(   r  r  kwsr  r  r[  r\  r)   s               r*   r  PairGrid._map_bivariate  s    
 	5t+/D(kkmDAKKNEKKNE14Bz  r?3?  	IdO...!$"3"34DN /r,   c                   S[        U5      R                  ;  a  U R                  " XX440 UD6  gUR                  5       n[	        UR
                  5      R                  S5      (       a  X5S'   O[        R                  " U5        X:X  a  U/nOX/nU R                  b+  U R                  U;  a  UR                  U R                  5        U R                  U   nU R                  (       a  UR                  5       nXq   nXr   n	U R                  c  Sn
OUR                  U R                  5      n
SU;  a(  UR                  XR                   U R"                  S.5        U" SXS.UD6  U R%                  U5        g)z,Draw a bivariate plot on the specified axes.r   Nr#  r)   )r   r   r   r>  r?  r#   )r   r  _plot_bivariate_iter_huerB   r&  rH   r*  r   rS  rr   rv   r   r   r   rq   r   r  r  r   )r'   r[  r\  r)   r8   r(   	axes_varsr   r>  r?  r   s              r*   r  PairGrid._plot_bivariate,  s4   	$222))%KFKt**9554LGGBK>II==$i)GT]]+yy#<<;;=DKK== C((4==)CMMTEWEW  	 q    $r,   c                   UR                  5       n[        UR                  5      R                  S5      (       a  X5S'   O[        R
                  " U5        X:X  a  U/nOX/nU R                  R                  U R                  SS9n[        U R                  5       H  u  pUR                  5       n
 UR                  U	5      nU R                   (       a  X   R#                  5       nX   nX   nU R$                  R'                  5        H  u  pX   X'   M     U
R)                  SU R*                  U   5        U R,                  b  XS'   [        UR                  5      R                  S5      (       a  U" S
XS	.U
D6  M  U" X40 U
D6  M     U R/                  U5        g! [         a    [        R                  " U[        S9n Nf = f)z7Draw a bivariate plot while iterating over hue subsets.r#  r)   Tr  )columnsr  r   Nr   r  r#   )rB   r&  rH   r*  r   rS  r   r  r  r  r  r  r  r  	DataFramer  r   r   r   r-  rC   r   rr   r   )r'   r[  r\  r)   r8   r(   r  r  r  r  r  r  r>  r?  r7  r8  s                   r*   r  !PairGrid._plot_bivariate_iter_hueS  sz   t**9554LGGBK>IIii'''E#DOO4JA++-C3$..w7
 ||*113AA $ 2 2 4"+ !5NN7DLLO4}}(&G4??#..y99%q%%Q!S!5 58 	  $+  3i,133s   0F#F?>F?c                   [        U R                  SSS24   U R                  5       H  u  pUR                  U5        M     [        U R                  SS2S4   U R                  5       H  u  pUR                  U5        M     g)z'Add labels to the left and bottom Axes.rx  Nr   )r   r$   r  r`  r  re  )r'   r)   r   s      r*   r  PairGrid._add_axis_labels  sa    TYYr1u-t{{;IBMM%  <TYYq!t_dkk:IBMM%  ;r,   c                d    / nU H'  n[        X   5      S:X  d  M  UR                  U5        M)     U$ )z0Find which variables in a DataFrame are numeric.numeric)r	   rv   )r'   r   r  r   s       r*   r  PairGrid._find_numeric_cols  s6    CTY'94##C(  r,   )r  r  r   rT   r/   r  rr   rh   r  rS   rR   r$   r   r  r  r  r   ri   r  r   r  r  r  )rG   rH   rI   rJ   rK   rU   rl   r  r  r  r  r  r  r  r  r  r  rM   r  r  s   @r*   r   r     sw      d4d5d1T%m* m*^"0Pd%N5,%%N*%X! r,   r   c                  ~    \ rS rSrSr SSSSSSSSSSSSSSS.S	 jjrS
 rS rS rS r	SSSSSSS.S jr
SS jrSrg)r   i  zGrid 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?  r   r   ratiospacer   r   hue_normr   r   r   marginal_ticksc          	       ^^ [         R                  " XU4S9n[         R                  " US-   US-   5      nUR                  USS 2S S24   5      nUR                  USS S24   US9nUR                  USS 2S4   US9nXl        UU l        UU l        UU l        [         R                  " UR                  5       SS9  [         R                  " UR                  5       SS9  [         R                  " UR                  S	S
9SS9  [         R                  " UR                  S	S
9SS9  U(       Gdt  [         R                  " UR                  R                  5       SS9  [         R                  " UR                  R                  5       SS9  [         R                  " UR                  R                  5       SS9  [         R                  " UR                  R                  5       SS9  [         R                  " UR                  5       SS9  [         R                  " UR                  5       SS9  [         R                  " UR                  S	S
9SS9  [         R                  " UR                  S	S
9SS9  UR                  R                  S5        UR                  R                  S5        [!        U[#        X#US9S9mTR$                  R&                  S S 2TR$                  R)                  5       R+                  5       4   mU(       a  TR-                  5       mUU4S jnU" S5      U l        U" S5      U l        U" S5      U l        S H:  nTR4                  R7                  US 5      nUc  M$  [9        USU S35      " U5        M<     Ub  UR;                  U5        Ub  UR=                  U5        [#        XU
S9U l        [@        RB                  " U5        U(       d*  [@        RB                  " US	S9  [@        RB                  " US	S9  UU4 H=  nUR                  UR                  4 H  nURD                  RG                  S5        M      M?     URI                  5         URK                  XwS9  g )Nr   r   rx  r   )r   )r   F)visibleT)minor)r>  r?  r   )r   	variablesc                   > TR                  U S 5      nUb+  UR                  TR                  R                  U S 5      5      nU$ rE  )rq   renamer  )r  r  pr9  s     r*   get_var#JointGrid.__init__.<locals>.get_var  s;    ]]3-F!q{{sD'ABMr,   r>  r?  r   r}  set_r   )r   r   r  r  )r)   bottom)hspacewspace)&r   r4   GridSpecr   r/   ax_joint	ax_marg_x	ax_marg_ysetpr   r  r  get_majorticklinesget_minorticklinesr   gridr   r   r9  ra   r  anyr   r>  r?  r   r  rq   r'  set_xlimset_ylim_hue_paramsr   r   r   r   rZ   r   )r'   r   r>  r?  r   r   r  r  r   r   r  r   r   r   r  fgsr(  r)  r*  r!  r   namer$   r   r9  s                           @@r*   rU   JointGrid.__init__  sw    JJ/0\\%!)UQY/==ABG-MM"QV*XM>	MM"QRV*XM>	 "" 	**,e<**,e<***6F***6F HHY__7795IHHY__7795IHHY__7795IHHY__7795IHHY..0%@HHY..0%@HHY..T.:EJHHY..T.:EJOO  'OO  ' tta#/FGKKOOAq{{'8'8':'>'>'@$@A	 !((*I	 5>D;;??4.DDe"45d; 
 d#d#  xX 	aMMYT2MMYt4	*DTZZ0

&&u- 1 + 	
	5r,   c                    [        U5      R                  nUR                  5        H  u  pVXT;   d  M  UR                  XV5        M     g)z/Add params to kws if they are accepted by func.N)r   r  r-  rC   )r'   r8   r  r   func_paramsrL  rA  s          r*   _inject_kwargsJointGrid._inject_kwargs  s5    o00HC!s( 'r,   c                R    U R                   " U40 UD6  U R                  " U40 UD6  U $ )a  Draw the plot by passing functions for joint and marginal axes.

This method passes the ``kwargs`` dictionary to both functions. If you
need more control, call :meth:`JointGrid.plot_joint` and
:meth:`JointGrid.plot_marginals` directly with specific parameters.

Parameters
----------
joint_func, marginal_func : callables
    Functions to draw the bivariate and univariate plots. See methods
    referenced above for information about the required characteristics
    of these functions.
kwargs
    Additional keyword arguments are passed to both functions.

Returns
-------
:class:`JointGrid` instance
    Returns ``self`` for easy method chaining.

)plot_marginals
plot_joint)r'   
joint_funcmarginal_funcr(   s       r*   plotJointGrid.plot  s-    , 	M4V4
-f-r,   c                   UR                  5       n[        UR                  5      R                  S5      (       a  U R                  US'   O [
        R                  " U R                  5        U R                  b+  U R                  US'   U R                  XU R                  5        [        UR                  5      R                  S5      (       a!  U" SU R                  U R                  S.UD6  U $ U" U R                  U R                  40 UD6  U $ )a;  Draw a bivariate plot on the joint axes of the grid.

Parameters
----------
func : plotting callable
    If a seaborn function, it should accept ``x`` and ``y``. Otherwise,
    it must accept ``x`` and ``y`` vectors of data as the first two
    positional arguments, and it must plot on the "current" axes.
    If ``hue`` was defined in the class constructor, the function 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.

r#  r)   r   r  r#   )rB   r&  rH   r*  r(  r   rS  r   r9  r2  r>  r?  )r'   r8   r(   s      r*   r=  JointGrid.plot_joint
  s    ( t**955==F4LGGDMM"88 HHF5Md.>.>?t**955.466TVV.v.  *6*r,   c                   [        UR                  5      R                  S5      =(       a    UR                  S:X  + n[	        U5      R
                  nUR                  5       nU R                  b+  U R                  US'   U R                  XU R                  5        SU;   a  UR                  SS5        SU;   a	  SS0nSS0nOSU;   a  SS0nSS	0nU(       a   U" SU R                  U R                  S
.UD6  O5[        R                  " U R                  5        U" U R                  40 WDUD6  U(       a   U" SU R                  U R                   S.UD6  O5[        R                  " U R                   5        U" U R                  40 WDUD6  U R                  R"                  R%                  5       R'                  S5        U R                   R(                  R%                  5       R'                  S5        U $ )a  Draw 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.

r#  distplotr   rx   Forientationvertical
horizontalT)r>  r)   )r?  r)   r#   )r&  rH   r*  rG   r   r  rB   r   r9  r2  rC   r>  r)  r   rS  r?  r*  r  	get_labelr   r   )r'   r8   r(   seaborn_funcr8  orient_kw_xorient_kw_ys          r*   r<  JointGrid.plot_marginals.  s   ,  ++I6 0MMZ/ 	
  o0088 HHF5Md.>.>?{"h.K'(*5K(,7K;&%u-K%t,K7466dnn77GGDNN#1;1&17466dnn77GGDNN#1;1&1&&(44U;&&(44U;r,   Tr  r  )r>  r?  jointmarginalr   r  c               B   XWS'   XgS'   UbH  U(       a  U R                   R                  " U40 UD6  U(       a  U R                  R                  " U40 UD6  UbH  U(       a  U R                   R                  " U40 UD6  U(       a  U R                  R                  " U40 UD6  U $ )a  Add 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 <matplotlib.colors>`
    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   r  )r(  r  r)  r  r*  )r'   r>  r?  rN  rO  r   r  r  s           r*   r  JointGrid.reflinek  s    6 " )=%%a484&&q5H5=%%a484&&q5H5r,   c                z    U R                   R                  " U40 UD6  U R                   R                  " U40 UD6  U $ )a  Set 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.

)r(  r`  re  )r'   xlabelylabelr(   s       r*   rO  JointGrid.set_axis_labels  s7    & 	  262  262r,   )r/   r2  r(  r)  r*  r   r>  r?  rE  )r!  r!  )rG   rH   rI   rJ   rK   rU   r9  r@  r=  r<  r  rO  rM   r#   r,   r*   r   r     sh     P6
$Dt4d5P6d)4"H;| 4tdd*Xr,   r   a  Set 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)r   rV  scatterautor  F)r   r   r   r  r  r  kind	diag_kindmarkersr   r   r  r   plot_kwsdiag_kwsgrid_kwsrb   c               H   SSK JnJn  Ub  Un
Sn[        R                  " U[
        5        [        U [        R                  5      (       d  [        S[        U 5       35      eUc  0 OUR                  5       nUc  0 OUR                  5       nUc  0 OUR                  5       nUS:X  a  Uc  US:X  a  SOSnO
US:X  a  SOSnUR                  SUS:H  5        [        U 4XEXaX#UXUS	.
UD6nU	b  US
:X  ad  UR                  c  SnO[        UR                  5      n[        U	[         5      (       d  U	/U-  n	[        U	5      U:w  a  [#        S5      eSU	0Ul        O.US:X  a(  [        U	[&        5      (       a  XS'   OUb  X   US'   XS'   UR                  5       nUR                  SS5        US:X  a  UR(                  " U40 UD6  O=US:X  a7  UR                  SS5        UR                  SS5        UR(                  " U40 UD6  Ub  UR*                  nOUR,                  nUS:X  a  SSKJn  U" U40 UD6  OSUS
:X  a  SSKJn  U" U40 UD6  O=US:X  a"  SSK Jn  UR                  SS5        U" U40 UD6  OUS:X  a  SSK Jn  U" U40 UD6  Ub  UR7                  5         UR9                  5         U$ )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

r   r  zKThe `size` parameter has been renamed to `height`; please update your code.z-'data' must be pandas DataFrame object, not: rX  kdehistr  )
r  r  r  r   r   r   r  r   r   r   regzSmarkers must be a singleton or a list of markers for each level of the hue variablemarkerrW  rI  r[  rx   FfillTwarn_singularscatterplot)regplot)r  )r  )r   r  r  r   r   UserWarningrt   r  r  	TypeErrortyperB   rC   r   ri   r   rj   r   r   r&  r  r  rl   
relationalrg  
regressionrh  r   rZ   )r   r   r   r   r  r  r  rY  rZ  r[  r   r   r  r   r\  r]  r^  rb   r  r  msgr.  	n_markersplotterrg  rh  s                             r*   r   r     s   f 1 *c;'dBLL));DJ<HJ 	J %r8==?H%r8==?H%r8==?H F;!%FI"&&.eI yF':;D Mt6'!MCKMD 5=~~%	/	gt,,")i/7|y(  "N O O$g.DLY'3''%,"$(I!&-# }}H%(Fh+(+	e	FD)OU3g** ""((y+(x(	'$8$	*OU3$8$	+%H% Kr,   r  r  r  )r>  r?  r   rY  r   r  r  r   r   r   r   r   r   r  r  	joint_kwsmarginal_kwsc               l   SSK Jn  SSKJnJn  SSKJnJnJn  UR                  SS 5      b  Sn[        R                  " U[        SS9  Uc  0 OUR                  5       nUR                  U5        Uc  0 OUR                  5       n/ S	Qn/ nU H-  nUU;   d  M  UR                  U5        UR                  U5        M/     U(       aA  US
:w  a;  SR!                  SR#                  U5      5      n[        R                  " U[        5        / SQn[%        SUU5        Ub  US;   a  SU S3n['        U5      eUc  Sn[(        R*                  R,                  R/                  U5      n[0        R2                  " SSS5       Vs/ s H  n[5        UUS9PM     n n[7        U SS9n!US:X  a  Sn[9        XX#XUXXgXUS9n"U"R:                  b  UR=                  SS5        UR?                  S5      (       a  UR=                  SU5        U"R@                  " U40 UD6  U"R:                  c  Un#O&Un#UR=                  SS5        UR=                  SS5        UR=                  SU5        U"RB                  " U#40 UD6  GOUR?                  S 5      (       a  UR=                  SU5        U"R@                  " U40 UD6  UR=                  S
S5        UR=                  SU5        UR                  5       n$UR                  5       n%S!n&U& HU  n[E        URG                  U5      [H        5      (       d  M)  UU   u  n'n(U$R=                  UU'5        U%R=                  UU(5        MW     U" S+XUS".U$DSU"RJ                  0D6  U" S+XUS#.U%DSU"RL                  0D6  GOUR?                  S
5      (       ay  UR=                  SU5        UR=                  SS5        U"R@                  " U40 UD6  UR=                  SU5        SU;   a  UR=                  SUS   5        U"RB                  " U40 UD6  GO
UR?                  S5      (       a  [O        U" U"RP                  5      S$5      n)[O        U" U"RR                  5      S$5      n*[U        [0        RV                  " U)U*/5      5      n+UR=                  S%U+5        UR=                  S&U!5        U"R@                  " [X        RZ                  40 UD6  UR=                  S
S5        UR=                  SU5        U"RB                  " U40 UD6  GOUR?                  S'5      (       a]  UR=                  SU5        UR=                  S
S5        U"RB                  " U40 UD6  UR=                  SU5        U"R@                  " U40 UD6  OUR?                  S(5      (       a  UR=                  SU5        U"R@                  " U40 UD6  U"R\                  R^                  S   Ra                  5       Rb                  u  pUR=                  SU5        U" S+XU"RJ                  S).UD6  U" S+X#U"RL                  S*.UD6  [X        Rd                  " U"R\                  5        U"$ s  snf ),Nr   rf  )rh  	residplot)r  r  _freedman_diaconis_binsr)   z4Ignoring `ax`; jointplot is a figure-level function.rf   )
stacklevel)rugfithist_kwsnorm_histhist_kwsrug_kwsr`  znThe marginal plotting function has changed to `histplot`, which does not accept the following argument(s): {}.z, )rW  ra  hexr`  rb  residrY  )r|  rb  r}  zUse of `hue` with `kind='z'` is not currently supported.C0r      )lT)as_cmapr|  )r   r>  r?  r   r   r   r  r   r   r  r  r   r   r  rx   FrW  r   re  rd  ra  )binsbinwidthbinrange)r   r>  r   )r   r?  r   2   gridsizecmaprb  r}  )r>  r   r)   )r?  r   r)   r#   )3rl  rg  rm  rh  rt  r   r  r  ru  r%  r   r   ri  rB   r   rv   r(  r  r   r   rn   r   colorConverterto_rgbr   linspacer   r   r   r   rC   r*  r=  r<  rt   rq   ru   r)  r*  minr>  r?  r   meanr   hexbinr(  collectionsget_offsetsTrS  ),r   r>  r?  r   rY  r   r  r  r   r   r   r   r   r   r  r  rq  rr  r(   rg  rh  rt  r  r  ru  rn  distplot_keysunused_keysrL  
plot_kinds	color_rgbrA  r   r  r.  	marg_func
marg_x_kws
marg_y_kws	pair_keysx_valy_valx_binsy_binsr  s,                                               r*   r   r     s    (.IIzz$)Dc;15  'Y^^-=IV%-2<3D3D3FLM K,s#S!  tu}D
&;'
( 	 	c;' CJFJ- 4#::)$/MNo }

))007I:<++aB:OP:O3nY#.:OFP.D u} !xE^	D xx%0 y!!We,1y188 II##OU;##FD1/I66		 	 
 	We,.I.u-/!&&(
!&&(
2	C)--,e44(~u%%c51%%c51	  	JdSJJJ4>>JJdSJJJ4>>J			We,_e4-9-/Y##FIf,=>G4|4			,TVV4b9,TVV4b9rww/01Z2VT*

0i0u-/H55			/t,H55We,-9-		!	!We,	/Y/}}((+779;;/A1$..ALAA1$..ALA GGDMMKU Qs   7X1a  Draw 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)r   r  rV  rE  )7
__future__r   	itertoolsr   inspectr   r   textwrapr   numpyr   pandasr  r$  rn   matplotlib.pyplotpyplotr   _baser   r	   r
   
_core.datar   _compatr   r   r!  r   r   r   r   r   r   palettesr   r   _docstringsr   r   __all__from_nested_components_param_docsr    rO   r   r  r   r   r   r(  rU   rK   r   r   r#   r,   r*   <module>r     s*   "         B B * 3   3
 J "88	H	
?- ?-DK9 K\ 	  
	
   	   	
   	
   	
   	   	
   	   	
   	   	i8vf/ f/Rst sl]	 ]@	%J Fy!  K 
   Z 	d	d4	fdquD4dk^ 
]DdARDt
tE	]@5j Fy!y!  k 
 r,   