pysteps.visualization.motionfields.streamplot

pysteps.visualization.motionfields.streamplot(UV, ax=None, map=None, geodata=None, drawlonlatlines=False, basemap_resolution='l', cartopy_scale='50m', lw=0.5, cartopy_subplot=(1, 1, 1), axis='on', **kwargs)

Function to plot a motion field as streamlines.

Parameters:
UV : array-like

Array of shape (2, m,n) containing the input motion field.

ax : axis object

Optional axis object to use for plotting.

map : {‘basemap’, ‘cartopy’}, optional

Optional method for plotting a map: ‘basemap’ or ‘cartopy’. The former uses `mpl_toolkits.basemap`_, while the latter uses cartopy_.

geodata : dictionary

Optional dictionary containing geographical information about the field. If geodata is not None, it must contain the following key-value pairs:

drawlonlatlines : bool, optional

If set to True, draw longitude and latitude lines. Applicable if map is ‘basemap’ or ‘cartopy’.

basemap_resolution : str, optional

The resolution of the basemap, see the documentation of `mpl_toolkits.basemap`_. Applicable if map is ‘basemap’.

cartopy_scale : {‘10m’, ‘50m’, ‘110m’}, optional

The scale (resolution) of the map. The available options are ‘10m’, ‘50m’, and ‘110m’. Applicable if map is ‘cartopy’.

lw: float, optional

Linewidth of the map (administrative boundaries and coastlines).

cartopy_subplot : tuple or SubplotSpec_ instance, optional

Cartopy subplot. Applicable if map is ‘cartopy’.

axis : {‘off’,’on’}, optional

Whether to turn off or on the x and y axis.

Key Value
projection PROJ.4-compatible projection definition
x1 x-coordinate of the lower-left corner of the data raster (meters)
y1 y-coordinate of the lower-left corner of the data raster (meters)
x2 x-coordinate of the upper-right corner of the data raster (meters)
y2 y-coordinate of the upper-right corner of the data raster (meters)
yorigin a string specifying the location of the first element in the data raster w.r.t. y-axis: ‘upper’ = upper border, ‘lower’ = lower border
Returns:
out : axis object

Figure axes. Needed if one wants to add e.g. text inside the plot.

Other Parameters:
 
density : float

Controls the closeness of streamlines. Default : 1.5

color : string

Optional streamline color. This is a synonym for the PolyCollection facecolor kwarg in matplotlib.collections. Default : black