xarray.Dataset.plot.streamplot#
- Dataset.plot.streamplot(*args, x=None, y=None, u=None, v=None, hue=None, hue_style=None, row=None, col=None, col_wrap=None, ax=None, figsize=None, size=None, aspect=None, sharex=True, sharey=True, add_guide=None, subplot_kws=None, cbar_kwargs=None, cbar_ax=None, cmap=None, vmin=None, vmax=None, norm=None, infer_intervals=None, center=None, robust=None, colors=None, extend=None, levels=None, **kwargs)[source]#
Plot streamlines of Dataset variables.
Wraps
matplotlib.pyplot.streamplot().- Parameters:
ds (
Dataset)x (
HashableorNone, optional) β Variable name for x-axis.y (
HashableorNone, optional) β Variable name for y-axis.u (
HashableorNone, optional) β Variable name for the u velocity (in x direction). quiver/streamplot plots only.v (
HashableorNone, optional) β Variable name for the v velocity (in y direction). quiver/streamplot plots only.hue (
HashableorNone, optional) β Variable by which to color scatter points or arrows.hue_style (
{'continuous', 'discrete'}orNone, 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)
row (
HashableorNone, optional) β If passed, make row faceted plots on this dimension name.col (
HashableorNone, optional) β If passed, make column faceted plots on this dimension name.col_wrap (
int, optional) β Use together withcolto wrap faceted plots.ax (
matplotlib axes objectorNone, optional) β IfNone, use the current axes. Not applicable when using facets.figsize (
Iterable[float]orNone, optional) β A tuple (width, height) of the figure in inches. Mutually exclusive withsizeandax.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.aspect (
"auto","equal", scalar orNone, optional) β Aspect ratio of plot, so thataspect * sizegives the width in inches. Only used if asizeis provided.sharex (
boolorNone, optional) β If True all subplots share the same x-axis.sharey (
boolorNone, optional) β If True all subplots share the same y-axis.add_guide (
boolorNone, optional) β Add a guide that depends onhue_style:'continuous'β build a colorbar'discrete'β build a legend
subplot_kws (
dictorNone, optional) β Dictionary of keyword arguments for Matplotlib subplots (seematplotlib.figure.Figure.add_subplot()). Only applies to FacetGrid plotting.cbar_kwargs (
dict, optional) β Dictionary of keyword arguments to pass to the colorbar (seematplotlib.figure.Figure.colorbar()).cbar_ax (
matplotlib axes object, optional) β Axes in which to draw the colorbar.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.vmin (
floatorNone, 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 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.vmax (
floatorNone, 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 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.norm (
matplotlib.colors.Normalize, optional) β Ifnormhasvminorvmaxspecified, the corresponding kwarg must beNone.infer_intervals (
bool | None) β If True the intervals are inferred.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.colors (
stror array-like ofcolor-like, optional) β A single color or a list of colors. Thelevelsargument is required.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.