xarray.DataArray.xvec.plot

xarray.DataArray.xvec.plot#

DataArray.xvec.plot(*, row=None, col=None, col_wrap=None, hue=None, subplot_kws=None, figsize=None, geometry=None, vmin=None, vmax=None, cmap=None, center=None, robust=False, extend=None, levels=None, norm=None, **kwargs)#

Plot geometry with optional faceting and color mapping.

Uses GeoPandas to plot the geometry and data from the object.

Parameters:
arrxarray.DataArray or xarray.Dataset

The data to be plotted.

rowHashable or None, optional

If passed, make row faceted plots on this dimension name.

colHashable or None, optional

If passed, make column faceted plots on this dimension name.

col_wrapint, optional

Number of columns to wrap facets into. Use together with col.

hueHashable or None, optional

If passed, make faceted plots with value on from this dimension.

subplot_kwsdict, optional

Dictionary of keyword arguments for Matplotlib subplots (see add_subplot()).

figsizetuple, optional

A tuple (width, height) of the figure in inches.

geometrystr, optional

Geometry array to use for plotting. Could be both coordinate geometry and variable geometry. If None, the method tries to infer the geometry when plotting a DataArray. Must be specified for a Dataset.

vminfloat or None, optional

Lower value to anchor the colormap, otherwise it is inferred from the data and other keyword arguments. When a diverging dataset is inferred, setting vmin or vmax will fix the other by symmetry around center. Setting both values prevents use of a diverging colormap. If discrete levels are provided as an explicit list, both of these values are ignored.

vmaxfloat or None, optional

Upper value to anchor the colormap, otherwise it is inferred from the data and other keyword arguments. When a diverging dataset is inferred, setting vmin or vmax will fix the other by symmetry around center. Setting both values prevents use of a diverging colormap. If discrete levels are provided as an explicit list, both of these values are ignored.

cmapmatplotlib colormap name or colormap, optional

The mapping from data values to color space. Either a Matplotlib colormap name or object. If not provided, this will be either 'viridis' (if the function infers a sequential dataset) or 'RdBu_r' (if the function infers a diverging dataset). See Choosing Colormaps in Matplotlib for more information.

centerfloat or False, optional

The value at which to center the colormap. Passing this value implies use of a diverging colormap. Setting it to False prevents use of a diverging colormap.

robustbool, optional

If True and vmin or vmax are absent, the colormap range is computed with 2nd and 98th percentiles instead of the extreme values.

extend{‘neither’, ‘both’, ‘min’, ‘max’}, optional

How to draw arrows extending the colorbar beyond its limits. If not provided, extend is inferred from vmin, vmax and the data limits.

levelsint or array-like, optional

Split the colormap (cmap) into discrete color intervals. If an integer is provided, “nice” levels are chosen based on the data range: this can imply that the final number of levels is not exactly the expected one. Setting vmin and/or vmax with levels=N is equivalent to setting levels=np.linspace(vmin, vmax, N).

normmatplotlib.colors.Normalize, optional

If norm has vmin or vmax specified, the corresponding kwarg must be None.

**kwargsdict

Additional keyword arguments passed to geopandas plotting method.

Returns:
figmatplotlib.figure.Figure

The figure object containing the plot.

axsnumpy.ndarray of matplotlib.axes.Axes

Array of axes objects for the plot.