pysteps.visualization.precipfields.plot_precip_field¶
-
pysteps.visualization.precipfields.
plot_precip_field
(R, type='intensity', map=None, geodata=None, units='mm/h', bbox=None, colorscale='pysteps', probthr=None, title=None, colorbar=True, drawlonlatlines=False, lw=0.5, axis='on', cax=None, **kwargs)¶ Function to plot a precipitation intensity or probability field with a colorbar.
Parameters: - R : array-like
Two-dimensional array containing the input precipitation field or an exceedance probability map.
- type : {‘intensity’, ‘depth’, ‘prob’}, optional
Type of the map to plot: ‘intensity’ = precipitation intensity field, ‘depth’ = precipitation depth (accumulation) field, ‘prob’ = exceedance probability field.
- 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
Optional dictionary containing geographical information about the field. Required is map is not None.
If geodata is not None, it must contain the following key-value pairs:
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 - units : {‘mm/h’, ‘mm’, ‘dBZ’}, optional
Units of the input array. If type is ‘prob’, this specifies the unit of the intensity threshold.
- bbox : tuple, optional
Four-element tuple specifying the coordinates of the bounding box. Use this for plotting a subdomain inside the input grid. The coordinates are of the form (lower left x,lower left y,upper right x,upper right y). If map is not None, the x- and y-coordinates are longitudes and latitudes. Otherwise they represent image pixels.
- colorscale : {‘pysteps’, ‘STEPS-BE’, ‘BOM-RF3’}, optional
Which colorscale to use. Applicable if units is ‘mm/h’, ‘mm’ or ‘dBZ’.
- probthr : float, optional
Intensity threshold to show in the color bar of the exceedance probability map. Required if type is “prob” and colorbar is True.
- title : str, optional
If not None, print the title on top of the plot.
- colorbar : bool, optional
If set to True, add a colorbar on the right side of the plot.
- drawlonlatlines : bool, optional
If set to True, draw longitude and latitude lines. Applicable if map is ‘basemap’ or ‘cartopy’.
- lw: float, optional
Linewidth of the map (administrative boundaries and coastlines).
- axis : {‘off’,’on’}, optional
Whether to turn off or on the x and y axis.
- cax : Axes object, optional
Axes into which the colorbar will be drawn. If no axes is provided the colorbar axes are created next to the plot.
Returns: - ax : fig Axes
Figure axes. Needed if one wants to add e.g. text inside the plot.
Other Parameters: - Optional parameters are contained in **kwargs. See basemaps.plot_geography.