xoa.plot.plot_stick#
- xoa.plot.plot_stick(u, v=None, ax=None, scale=None, color=None, key=True, key_pos=None, **kwargs)[source]#
Plot a current time series as sticks
Each vector is drawn as a stick anchored at
y=0, oriented along the current and scaled by its speed. This shows the direction and intensity of the currents, like tidal ones, along a single axis.- Parameters:
u (xarray.DataArray, xarray.Dataset) – Eastward component with a single dimension. If it is a dataset, the
"u"and"v"generic meta names are searched in it withxoa.meta.v (xarray.DataArray, None) – Northward component, with the same dimension
ax (None, matplotlib.axes.Axes)
scale (None, float) – Scale passed to
matplotlib.axes.Axes.quiver(): the smaller, the longer the sticks.color (None, color) – Color of the sticks, which defaults to the
plot.stick_coloroptionkey (bool, str) – Add a reference stick that is labelled with its speed, as in
plot_vectors()key_pos (None, tuple(float)) – Position of the reference stick in axes coordinates, which defaults to the
plot.key_posoptionkwargs – Extra parameters are passed to
matplotlib.axes.Axes.quiver()
- Returns:
matplotlib.quiver.Quiver
Example
plot_stick(ds.u, ds.v, scale=2.0) plot_stick(ds) # u and v are searched
See also