pysteps.visualization.precipfields.plot_precip_field(precip, ptype='intensity', ax=None, geodata=None, units='mm/h', bbox=None, colorscale='pysteps', probthr=None, title=None, colorbar=True, axis='on', cax=None, map_kwargs=None)#

Function to plot a precipitation intensity or probability field with a colorbar.

  • precip (array-like) – Two-dimensional array containing the input precipitation field or an exceedance probability map.

  • ptype ({'intensity', 'depth', 'prob'}, optional) – Type of the map to plot: ‘intensity’ = precipitation intensity field, ‘depth’ = precipitation depth (accumulation) field, ‘prob’ = exceedance probability field.

  • geodata (dictionary or None, 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:




    PROJ.4-compatible projection definition


    x-coordinate of the lower-left corner of the data raster


    y-coordinate of the lower-left corner of the data raster


    x-coordinate of the upper-right corner of the data raster


    y-coordinate of the upper-right corner of the data raster


    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 ptype 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 ‘geodata’ is not None, the bbox is in map coordinates, otherwise it represents image pixels.

  • colorscale ({'pysteps', 'STEPS-BE', 'STEPS-NL', '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 ptype 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.

  • 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.

  • map_kwargs (dict) – Optional parameters that need to be passed to pysteps.visualization.basemaps.plot_geography().


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

Return type

fig Axes