xarray.plot.scatter
xarray.plot.scatter#
- xarray.plot.scatter(ds, x, y, ax, **kwargs)[source]#
Scatter Dataset data variables against each other.
Wraps
matplotlib.pyplot.scatter().- Parameters
ds (
Dataset)x, y (
str) – Variable names for the x and y grid positions.u, v (
str, optional) – Variable names for the u and v velocities (in x and y direction, respectively; quiver/streamplot plots only).hue (
str, optional) – Variable by which to color scatter points or arrows.hue_style (
{'continuous', 'discrete'}, optional) – How to use thehuevariable:'continuous'– continuous color scale (default for numerichuevariables)'discrete'– a color for each unique value, using the default color cycle (default for non-numerichuevariables)
markersize (
str, optional) – Variable by which to vary the size of scattered points (scatter plot only).size_norm (
matplotlib.colors.Normalizeortuple, optional) – Used to normalize themarkersizevariable. If a tuple is passed, the values will be passed tomatplotlib.colors.Normalizeas arguments. Default: no normalization (vmin=None,vmax=None,clip=False).scale (scalar, optional) – Quiver only. Number of data units per arrow length unit. Use this to control the length of the arrows: larger values lead to smaller arrows.
add_guide (
bool, optional, default:True) – Add a guide that depends onhue_style:'continuous'– build a colorbar'discrete'– build a legend
row (
str, optional) – If passed, make row faceted plots on this dimension name.col (
str, optional) – If passed, make column faceted plots on this dimension name.col_wrap (
int, optional) – Use together withcolto wrap faceted plots.ax (
matplotlib axes object, optional) – IfNone, use the current axes. Not applicable when using facets.subplot_kws (
dict, optional) – Dictionary of keyword arguments for Matplotlib subplots (seematplotlib.figure.Figure.add_subplot()). Only applies to FacetGrid plotting.aspect (scalar, optional) – Aspect ratio of plot, so that
aspect * sizegives the width in inches. Only used if asizeis provided.size (scalar, optional) – If provided, create a new figure for the plot with the given size: height (in inches) of each plot. See also:
aspect.norm (
matplotlib.colors.Normalize, optional) – Ifnormhasvminorvmaxspecified, the corresponding kwarg must beNone.vmin, vmax (
float, optional) – Values to anchor the colormap, otherwise they are inferred from the data and other keyword arguments. When a diverging dataset is inferred, setting one of these values will fix the other by symmetry aroundcenter. Setting both values prevents use of a diverging colormap. If discrete levels are provided as an explicit list, both of these values are ignored.cmap (matplotlib 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.If seaborn is installed,
cmapmay also be a seaborn color palette. Note: ifcmapis a seaborn color palette,levelsmust also be specified.colors (
stror array-like ofcolor-like, optional) – A single color or a list of colors. Thelevelsargument is required.center (
float, optional) – The value at which to center the colormap. Passing this value implies use of a diverging colormap. Setting it toFalseprevents use of a diverging colormap.robust (
bool, optional) – IfTrueandvminorvmaxare 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,extendis inferred fromvmin,vmaxand the data limits.levels (
intor 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. Settingvminand/orvmaxwithlevels=Nis equivalent to settinglevels=np.linspace(vmin, vmax, N).**kwargs (optional) – Additional keyword arguments to wrapped Matplotlib function.