U
    Cvf                     @  sr  d dl mZ d dlZd dlZd dlZd dlmZmZmZm	Z	m
Z
mZmZmZmZ d dlZd dlmZ d dlmZmZ d dlmZmZmZmZmZmZmZmZmZm Z m!Z! erd dl"m#Z# d dl$m%Z% d d	l&m'Z' d d
l(m)Z) d dl*m+Z+ d dl,m-Z- d dl.m/Z/ d dl0m1Z1 dZ2dZ3dd Z4edddZ5G dd de	e Z6d'dddddddddddddd d!d"d#d$d%d&Z7dS )(    )annotationsN)	TYPE_CHECKINGAnyCallableGenericHashableIterableLiteralTypeVarcast)format_item)HueStyleOptionsT_Xarray)_LINEWIDTH_RANGE_MARKERSIZE_RANGE_add_legend_determine_guide_get_nice_quiver_magnitude_infer_xy_labels
_Normalize_parse_size_process_cmap_cbar_kwargsimport_matplotlib_pyplotlabel_from_attrs)Axes)ScalarMappable)Colorbar)Figure)Legend)	QuiverKey)
Annotation	DataArraysmall   c                 C  s>   t |dd}|j| |d}t||kr:|d|d  d }|S )z>
    Put coord, value in template and truncate at maxchar
    F)Zquote_strings)coordvalueN   z...)r   formatlen)r%   r&   maxchartemplateZprettyvaluetitle r-   9/tmp/pip-unpacked-wheel-h316xyqg/xarray/plot/facetgrid.py
_nicetitle7   s
    r/   T_FacetGrid	FacetGrid)boundc                   @  s  e Zd ZU dZded< ded< ded< ded< d	ed
< d	ed< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded < ded!< d"ed#< d$ed%< d&ed'< dddddd&d&d,d-d-d.dd/d0d1Zedd2d3d4Zejddd5d6d4Zedd2d7d8Z	edd2d9d:Z
d;d<ddd=d;d>d?d@Zd;d<ddd=d;d>dAdBZdd;d<dddd&d=d;dCdDdEZdd;d<ddddFdGd=d;dH	dIdJZdKddLdMdNZdd2dOdPZd(dQdRdSd&d=ddTdUdVZd=ddWdXdYZdKdKd=ddZd[d\Zd]d2d^d_Zdd`d`d`ddadbdcZdKddLdddeZddfdgdSddhdidjZddkd=ddldmdnZddkd=ddldodpZddkd=ddldqdrZddfdddudvdwZeeefdddxddydzd{Zd;d<dKd=d;d|d}d~Zd(S )r1   a  
    Initialize the Matplotlib figure and FacetGrid object.

    The :class:`FacetGrid` is an object that links a xarray DataArray to
    a Matplotlib figure with a particular structure.

    In particular, :class:`FacetGrid` is used to draw plots with multiple
    axes, where each axes shows the same relationship conditioned on
    different levels of some dimension. It's possible to condition on up to
    two variables by assigning variables to the rows and columns of the
    grid.

    The general approach to plotting here is called "small multiples",
    where the same kind of plot is repeated multiple times, and the
    specific use of small multiples to display the same relationship
    conditioned on one ore more other variables is often called a "trellis
    plot".

    The basic workflow is to initialize the :class:`FacetGrid` object with
    the DataArray and the variable names that are used to structure the grid.
    Then plotting functions can be applied to each subset by calling
    :meth:`FacetGrid.map_dataarray` or :meth:`FacetGrid.map`.

    Attributes
    ----------
    axs : ndarray of matplotlib.axes.Axes
        Array containing axes in corresponding position, as returned from
        :py:func:`matplotlib.pyplot.subplots`.
    col_labels : list of matplotlib.text.Annotation
        Column titles.
    row_labels : list of matplotlib.text.Annotation
        Row titles.
    fig : matplotlib.figure.Figure
        The figure containing all the axes.
    name_dicts : ndarray of dict
        Array containing dictionaries mapping coordinate names to values. ``None`` is
        used as a sentinel value for axes that should remain empty, i.e.,
        sometimes the rightmost grid positions in the bottom row.
    r   dataz
np.ndarray
name_dictsr   figaxszlist[np.ndarray]	row_names	col_nameszLegend | None	figlegendzQuiverKey | None	quiverkeyzColorbar | Nonecbarzbool | Hashable_single_groupint_nrowHashable | None_row_var_ncol_col_var
int | None	_col_wrapzlist[Annotation | None]
row_labels
col_labelsNone_x_var_y_varz
Any | None_cmap_extendzlist[ScalarMappable]
_mappablesbool
_finalizedNT   r'   Iterable[float] | Nonefloatdict[str, Any] | None)r3   colrowcol_wrapsharexshareyfigsizeaspectsizesubplot_kwsreturnc              	     s|  t  } dk	o|   j }dk	o4|  j }|s>|rFtd rrdt| }t|  }|| }|dk	rtd n$r sns r ntdrt| } r|}rd}|dk	r|}tt	|| }|
dkri n|
}
|dkrd}||	 | | ||	 f}|j
||||d||
d\}} rPt|   ng }rjt|  ng }rfdd	|  D }d
d	 t|| t| D }|| }n t||} fdd	|D }t|||}|| _|| _|| _|| _|| _|| _d| _d| _d| _| _|| _| _|| _ | _|| _ dg| | _!dg| | _"d| _#d| _$d| _%g | _&d| _'dS )a  
        Parameters
        ----------
        data : DataArray or Dataset
            DataArray or Dataset to be plotted.
        row, col : str
            Dimension names that define subsets of the data, which will be drawn
            on separate facets in the grid.
        col_wrap : int, optional
            "Wrap" the grid the for the column variable after this number of columns,
            adding rows if ``col_wrap`` is less than the number of facets.
        sharex : bool, optional
            If true, the facets will share *x* axes.
        sharey : bool, optional
            If true, the facets will share *y* axes.
        figsize : Iterable of float or None, optional
            A tuple (width, height) of the figure in inches.
            If set, overrides ``size`` and ``aspect``.
        aspect : scalar, default: 1
            Aspect ratio of each facet, so that ``aspect * size`` gives the
            width of each facet in inches.
        size : scalar, default: 3
            Height (in inches) of each facet. See also: ``aspect``.
        subplot_kws : dict, optional
            Dictionary of keyword arguments for Matplotlib subplots
            (:py:func:`matplotlib.pyplot.subplots`).

        NzICoordinates used for faceting cannot contain repeated (nonunique) values.Fz4Ignoring col_wrap since both col and row were passedz4Pass a coordinate name as an argument for row or colrN   )rU   rV   ZsqueezerW   Z
subplot_kwc                   s   g | ]} |iqS r-   r-   .0x)single_groupr-   r.   
<listcomp>   s    z&FacetGrid.__init__.<locals>.<listcomp>c                 S  s   g | ]}d qS Nr-   r\   r-   r-   r.   r`      s    c                   s   g | ]\}}| |iqS r-   r-   r]   rc)rR   rS   r-   r.   r`      s     )(r   Zto_indexZ	is_unique
ValueErrorr)   warningswarnr=   npceilZsubplotslistto_numpyrange	itertoolsproductarrayreshaper3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r>   r@   rA   rB   rD   rE   rF   rH   rI   rJ   rK   rM   )selfr3   rR   rS   rT   rU   rV   rW   rX   rY   rZ   pltZrep_colZrep_rowZnrowZncolZnfacetZ
cbar_spacer5   r6   r8   r7   fullemptyZname_dict_listrowcolsr4   r-   )rR   rS   r_   r.   __init__   s    *




zFacetGrid.__init__)r[   c                 C  s   t jdtdd | jS Nzlself.axes is deprecated since 2022.11 in order to align with matplotlibs plt.subplots, use self.axs instead.   )
stacklevelrf   rg   DeprecationWarningr6   rq   r-   r-   r.   axes  s    zFacetGrid.axes)r6   r[   c                 C  s   t jdtdd || _d S rw   rz   )rq   r6   r-   r-   r.   r}   )  s    c                 C  s   | j d d df S )Nr   r6   r|   r-   r-   r.   
_left_axes5  s    zFacetGrid._left_axesc                 C  s   | j dd d f S )Nr~   r|   r-   r-   r.   _bottom_axes9  s    zFacetGrid._bottom_axesr0   r   r   )rq   funcr^   ykwargsr[   c              	   K  s*  | dddk	rtdt|| j f|\}}| d| _dd | D }|| d|d< |jd	krrd|d
< t	| jj
| jjd  |||jdk| ddd\}}t| jj| jjD ]F\}}	|dk	r| jj
| }
||
f|||	d|ddi}| j| q| || | ddr&| jf | | S )a+  
        Apply a plotting function to a 2d facet's subset of the data.

        This is more convenient and less general than ``FacetGrid.map``

        Parameters
        ----------
        func : callable
            A plotting function with the same signature as a 2d xarray
            plotting method such as `xarray.plot.imshow`
        x, y : string
            Names of the coordinates to plot on x, y axes
        **kwargs
            additional keyword arguments to func

        Returns
        -------
        self : FacetGrid object

        cbar_axN#cbar_ax not supported by FacetGrid.extendc                 S  s   i | ]\}}|d kr||qS >   cmapcolorslevelscbar_kwargsr-   r]   kvr-   r-   r.   
<dictcomp>c  s    z+FacetGrid.map_dataarray.<locals>.<dictcomp>Fadd_colorbarZsurface
add_labelsr   imshowrgb)darrayr^   r   r   r   r^   r   ax_is_facetgridT)getre   r   r3   rk   rJ   itemsupdate__name__r   locr4   flatzipr6   rK   append_finalize_gridr   )rq   r   r^   r   r   cmap_paramsr   func_kwargsdr   subsetmappabler-   r-   r.   map_dataarray=  sT     



  zFacetGrid.map_dataarrayc                   s   j   _ |dddk	r$td|dd}|r> j | n j }t|}| _|di }|j dk	r|js|j|j	|j
d |j|jd t|td|jj fd|i|\}	}|	d	 _ni }	|jd
krtnt}
dD ]T}||d}|r j | nd}t||
d}|r|j j |< |jf ||i  q0qdd | D }||	 d|d< d|d< d|d< tj jjd td}|ddk	rd|dd< n$d|ddddf< d|ddddf<  jrt fddtd j  j jD }tdd t j j t| D }|| }nBt !td j  j" jtd j  j# j}t fdd|D }t$|% j j}t&|% jjdf|j' jj'D ]T\}}}||d< |dk	r j (|}||f|||d|d di} j)*| q +   ,  t-|||dd|dd\}}|rr|jd!kr0dnd}|rf j.||sJ|ntd| j) j/|jd" n j.|d# |rd$|krt0|j |d$<  j1f |  S )%a  
        Apply a plotting function to a 1d facet's subset of the data.

        This is more convenient and less general than ``FacetGrid.map``

        Parameters
        ----------
        func :
            A plotting function with the same signature as a 1d xarray
            plotting method such as `xarray.plot.scatter`
        x, y :
            Names of the coordinates to plot on x, y axes
        **kwargs
            additional keyword arguments to func

        Returns
        -------
        self : FacetGrid object

        r   Nr   huer   )r(   ticks)r   r"   r   Zscatter)
markersizeZ	linewidth)r3   widthc                 S  s   i | ]\}}|d kr||qS r   r-   r   r-   r-   r.   r     s    z(FacetGrid.map_plot1d.<locals>.<dictcomp>Fr   
add_legendZ	add_title)r'   )ZdtypezTr   r   rN   c                 3  s   | ]} j |iV  qd S ra   )r<   r\   r|   r-   r.   	<genexpr>  s   z'FacetGrid.map_plot1d.<locals>.<genexpr>c                 s  s   | ]
}d V  qd S ra   r-   r\   r-   r-   r.   r     s     c                 3  s"   | ]\}} j | j|iV  qd S ra   )r@   rB   rb   r|   r-   r.   r     s     r   r   r   hist)use_legend_elementshueplt_normsizeplt_normZ	primitiveZ	legend_axplotfunc)r   label)2r3   copyr   re   r   _hue_varpopZdata_is_numericr   r(   r   r   r   r   valuesrJ   r   r   r   r   rh   zerosr6   shaperL   r<   tuplerl   rY   r>   rA   r)   rm   rn   r@   rB   ro   rp   r   r   ZiselrK   r   r   	_set_limsr   r   r5   r   r   )rq   r   r^   r   r   r   huepltr   r   r   Z_size_r_sizerY   Zsizepltr   r   Zadd_labels_rs   rt   Zname_dru   r4   Zadd_lblsr   r   r   r   r   r   r   r-   r|   r.   
map_plot1d  s     


&
  


		
zFacetGrid.map_plot1d)rq   r   r^   r   r   r   r   r[   c              
   K  s   ddl m} t| jj| jjD ]F\}	}
|	d k	r| jj|	 }||f|||
|ddd|}| j	| q|| jj| jjd  |||d\}}}}t
|}t
|}|| _| || |r|d k	r|d k	r| j|d | S )Nr   )_infer_line_dataF)r^   r   r   r   r   _labels)r   r^   r   r   r   )Zxarray.plot.dataarray_plotr   r   r4   r   r6   r3   r   rK   r   r   r   r   r   )rq   r   r^   r   r   r   r   r   r   r   r   r   r   ZxpltZypltr   Zhuelabelxlabelylabelr-   r-   r.   map_dataarray_line-  s<    

   zFacetGrid.map_dataarray_liner   zbool | None)	rq   r   r^   r   r   	hue_style	add_guider   r[   c              
   K  s  ddl m} d|d< |dd r@t| j|d  |dd |d< || j||||||jd}	|	|d	< |r|	d
 dkrt|| j|  f|\}
}|
|d	 d< ||d	 d< d|d< |jdkrd|krt	dt
| jj| jjD ]D\}}|d k	r| jj| }|f ||||||d|}| j| q| |	d |	d  |r|	dd }|| _|	d rn|	d | _| j|d n|	d r| jf d|i| |	d r| |d |d  | S )Nr   )_infer_meta_dataFr   r   Z	size_normZsize_mapping)funcname	meta_datar   Z
continuousr   r   Tr   ZquiverZscalezPlease provide scale.)Zdsr^   r   r   r   r   r   r   	hue_labelr   r   r   r   r   add_quiverkeyur   )Zxarray.plot.dataset_plotr   r   r   r3   r   r   r   rk   re   r   r4   r   r6   r   rK   r   r   Z
_hue_labelr   r   r   r   )rq   r   r^   r   r   r   r   r   r   r   r   r   r   r   r   maybe_mappabler   r-   r-   r.   map_datasetW  sn    
 
            



zFacetGrid.map_datasetr   )axlabelsr[   c                 G  sZ   | j sV| j|  |   | j  t| jj| jjD ]\}}|dkr4|	d q4d| _ dS )z$Finalize the annotations and layout.NFT)
rM   set_axis_labels
set_titlesr5   Ztight_layoutr   r6   r   r4   Zset_visible)rq   r   r   namedictr-   r-   r.   r     s    

zFacetGrid._finalize_gridc                 C  s   | j j }| j | ||j| j j }| j  }|| }| j | | j | ||j| j j }|| d }d| }| j j	|d d S )Ng{Gz?rN   )right)
r5   ZcanvasZget_rendererZdrawZget_window_extentr   ZdpiZget_figwidthZset_figwidthZsubplots_adjust)rq   ZguideZrendererZguide_widthZfigure_widthZtotal_widthZspace_neededr   r-   r-   r.   _adjust_fig_for_guide  s    
zFacetGrid._adjust_fig_for_guideF)r   r   z
str | None)r   r   r   r[   c             	   K  sj   |rt f || _nH| jjf | jd t| j |d k	r:|nt| j|	ddd|| _| 
| j d S )Nr   r   zcenter right)Zhandleslabelsr,   r   )r   r9   r5   ZlegendrK   rj   r   rk   r   r   r   )rq   r   r   r   r-   r-   r.   r     s    
zFacetGrid.add_legend)r   r[   c                 K  s   |  }| jdk	r |d| j t| jd dr<|dd d|krV|dt| j | jj	| jd fdt
| jji|| _dS )zDraw a colorbar.Nr   r   r   r   )r   rJ   
setdefaulthasattrrK   r   r   r3   r5   Zcolorbarrj   r6   r   r;   )rq   r   r-   r-   r.   r     s    

zFacetGrid.add_colorbar)r   r   r   r[   c              	   K  sh   |  }t| j| | j| }| j| jdd}| jjd j| jd dd|| d| ddd	| _d S )
Nunits r   g?g?
Efigure)XYUr   ZlabelposZcoordinates)	r   r   r3   attrsr   r6   r   r:   rK   )rq   r   r   r   Z	magnituder   r-   r-   r.   r     s    zFacetGrid.add_quiverkeyzdict[str, tuple[float, float]]c           	      C  s   t tjtj ftjtj ftjtj fd}dD ]b}|| \}}| jjD ]<}t|d| dd}|rH| \}}t||t|| }}qH||f||< q0|S )a  
        Get largest limits in the facetgrid.

        Returns
        -------
        lims_largest : dict[str, tuple[float, float]]
            Dictionary with the largest limits along each axis.

        Examples
        --------
        >>> ds = xr.tutorial.scatter_example_dataset(seed=42)
        >>> fg = ds.plot.scatter(x="A", y="B", hue="y", row="x", col="w")
        >>> round(fg._get_largest_lims()["x"][0], 3)
        -0.334
        )r^   r   r   get_limN)dictrh   infr6   r   getattrminmax)	rq   lims_largestaxislowerupperr   Zget_limZ	lower_newZ	upper_newr-   r-   r.   _get_largest_lims  s$       
 
zFacetGrid._get_largest_limsztuple[float, float] | None)r^   r   r   r[   c           
      C  sh   |   }| jjD ]R}t| |||fD ]8\\}}}t|d| dd}	|	r(|	|dkrZ|n| q(qdS )a  
        Set the same limits for all the subplots in the facetgrid.

        Parameters
        ----------
        x : tuple[float, float] or None, optional
            x axis limits.
        y : tuple[float, float] or None, optional
            y axis limits.
        z : tuple[float, float] or None, optional
            z axis limits.

        Examples
        --------
        >>> ds = xr.tutorial.scatter_example_dataset(seed=42)
        >>> fg = ds.plot.scatter(x="A", y="B", hue="y", row="x", col="w")
        >>> fg._set_lims(x=(-0.3, 0.3), y=(0, 2), z=(0, 4))
        >>> fg.axs[0, 0].get_xlim(), fg.axs[0, 0].get_ylim()
        ((-0.3, 0.3), (0.0, 2.0))
        set_r   N)r   r6   r   r   r   r   )
rq   r^   r   r   r   r   r   Z
data_limitZparameter_limitZset_limr-   r-   r.   r     s     zFacetGrid._set_limsc                 G  sr   ddl m} t|dddgD ]P\}}|dk	rt||rRt| d| dt| qt| d| dt| qdS )	z>Set axis labels on the left column and bottom row of the grid.r   r!   r^   r   r   Nr   r   )xarray.core.dataarrayr"   r   
isinstancer   r   str)rq   r   r"   varr   r-   r-   r.   r   6  s    
zFacetGrid.set_axis_labelsr   r   )r   r}   r   r[   c                 K  sL   |d kr$t | jt| d| d }|D ]}t|d| d|f| q(d S )N_Z_varr   r   )r   r3   r   )rq   r   r}   r   r   r   r-   r-   r.   _set_labelsA  s    zFacetGrid._set_labelsz
None | str)r   r   r[   c                 K  s   | j d| j|f| dS )z/Label the x axis on the bottom row of the grid.r^   N)r   r   rq   r   r   r-   r-   r.   set_xlabelsI  s    zFacetGrid.set_xlabelsc                 K  s   | j d| j|f| dS )z0Label the y axis on the left column of the grid.r   Nr   r   r   r-   r-   r.   set_ylabelsM  s    zFacetGrid.set_ylabelsc                 K  s   | j d| j|f| dS )zLabel the z axis.r   Nr   r   r-   r-   r.   set_zlabelsQ  s    zFacetGrid.set_zlabels{coord} = {value}   )r+   r*   r[   c              	   K  s  ddl }|dkr|jd }tjt||d}| jrt| jj| j	jD ]H\}}|dk	rBt
|  \}	}
||	|
|d}|j|fd|i| qBntt| j	dddf | j| jD ]\\}\}}}|| j||d}|s|j|fd	d
dddd|| j|< q|| || qtt| j	dddf | j| jD ]X\}\}}}|| j||d}|sr|j|fd|i|| j|< n|| || q0dS )a  
        Draw titles either above each facet or on the grid margins.

        Parameters
        ----------
        template : str, default: "{coord} = {value}"
            Template for plot titles containing {coord} and {value}
        maxchar : int, default: 30
            Truncate titles at maxchar
        **kwargs : keyword args
            additional arguments to matplotlib.text

        Returns
        -------
        self: FacetGrid object

        r   Nzaxes.labelsize)r*   r+   )r*   rY   r   )r%   r&   r*   )gRQ?g      ?zaxes fractioni  leftcenter)ZxyZxycoordsZrotationZhava)Z
matplotlibZrcParams	functoolspartialr/   r<   r   r4   r   r6   rj   r   r   	set_title	enumerater7   rE   r@   ZannotateZset_textr   r8   rF   rB   )rq   r+   r*   rY   r   ZmplZ	nicetitler   r   r%   r&   r,   indexZrow_namehandleZcol_namer-   r-   r.   r   U  sH    



zFacetGrid.set_titlesz	str | int)
max_xticks
max_yticksfontsizer[   c           	      C  st   ddl m} ||d}||d}| jjD ]F}|j| |j| t|j	 |j	 D ]}|j
| q\q(dS )a[  
        Set and control tick behavior.

        Parameters
        ----------
        max_xticks, max_yticks : int, optional
            Maximum number of labeled ticks to plot on x, y axes
        fontsize : string or int
            Font size as used by matplotlib text

        Returns
        -------
        self : FacetGrid object

        r   )MaxNLocator)ZnbinsN)Zmatplotlib.tickerr  r6   r   ZxaxisZset_major_locatorZyaxisrm   chainZget_major_tickslabel1Zset_fontsize)	rq   r  r  r  r  Zx_major_locatorZy_major_locatorr   Ztickr-   r-   r.   	set_ticks  s    

 zFacetGrid.set_ticks)rq   r   argsr   r[   c           	        s   t  }t| jj| jjD ]\\}}|dk	r| jj|  ||  fdd|D }|||}|rt|dr| j	
| q| j|dd   | S )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 : Hashable
            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 : FacetGrid object

        Nc                   s   g | ]} |   qS r-   )rk   )r]   ar3   r-   r.   r`     s     z!FacetGrid.map.<locals>.<listcomp>Zautoscale_Nonerx   )r   r   r6   r   r4   r3   r   Zscar   rK   r   r   )	rq   r   r  r   rr   r   r   Z	innerargsr   r-   r  r.   map  s    

zFacetGrid.map)	NNNTTNrN   r'   N)TN)NNNNN)NNN)N)N)N)N)r   r   N) r   
__module____qualname____doc____annotations__rv   propertyr}   setterr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   _NTICKS	_FONTSIZEr  r  r-   r-   r-   r.   r1   G   s   
(         $ I .  -      @#   %    G#Tr   r   z3Literal[('line', 'dataarray', 'dataset', 'plot1d')]r?   rC   rL   zfloat | NonerQ   zAxes | NonerO   r   zFacetGrid[T_Xarray])r3   r   kindr^   r   rS   rR   rT   rU   rV   rX   rY   rZ   r   rW   r   r[   c                 K  s   |dk	rt d|
dkrd}
|dkr*d}n|dk	r:t d|ddk	rPd}d}	t| |||||	||
||d
}|d	kr|j|||f|S |d
kr|j|||f|S |dkr|j|||f|S |dkr|j|||f|S t d| dS )z
    Convenience method to call xarray.plot.FacetGrid from 2d plotting methods

    kwargs are the arguments to 2d plotting method
    Nz)Can't use axes when making faceted plots.rN   r'   z2cannot provide both `figsize` and `size` argumentsr   F)
r3   rR   rS   rT   rU   rV   rW   rX   rY   rZ   lineZ	dataarrayZplot1dZdatasetzDkind must be one of `line`, `dataarray`, `dataset` or `plot1d`, got )re   r   r1   r   r   r   r   )r3   r   r  r^   r   rS   rR   rT   rU   rV   rX   rY   rZ   r   rW   r   gr-   r-   r.   _easy_facetgrid  sD    r  )NNNNNTTNNNNN)8
__future__r   r   rm   rf   typingr   r   r   r   r   r   r	   r
   r   Znumpyrh   Zxarray.core.formattingr   Zxarray.core.typesr   r   Zxarray.plot.utilsr   r   r   r   r   r   r   r   r   r   r   Zmatplotlib.axesr   Zmatplotlib.cmr   Zmatplotlib.colorbarr   Zmatplotlib.figurer   Zmatplotlib.legendr   Zmatplotlib.quiverr   Zmatplotlib.textr    r   r"   r  r  r/   r0   r1   r  r-   r-   r-   r.   <module>   sT   ,4       ,            