wradlib.vis.VisMethods.contourf#
- VisMethods.contourf(*, ax=111, fig=None, crs=None, func='pcolormesh', cmap='viridis', center=False, add_colorbar=False, add_labels=False, **kwargs)[source]#
Plot Plan Position Indicator (PPI) or Range Height Indicator (RHI).
The implementation of this plot routine is in cartesian axes and does all coordinate transforms using xarray machinery. This allows zooming into the data as well as making it easier to plot additional data (like gauge locations) without having to convert them to the radar’s polar coordinate system.
Using
crs='cg'
the plotting is done in a curvelinear grid axes.Additional data can be plotted in polar coordinates or cartesian coordinates depending which axes object is used.
**kwargs
may be used to try to influence thematplotlib.pyplot.pcolormesh
,matplotlib.pyplot.contour
,matplotlib.pyplot.contourf
andwradlib.georef.polar.spherical_to_proj
routines under the hood.- Parameters
crs (
cartopy.crs.CRS
,dict
orNone
) – cartopy CRS Coordinate Reference System describing projection If this parameter is not None,site
must be set properly. Then the function will attempt to georeference the radar bins and display the PPI in the coordinate system defined by the projection string.fig (
matplotlib.figure.Figure
) – If given, the PPI/RHI will be plotted into this figure object. Axes are created as needed. If None, a new figure object will be created or current figure will be used, depending onax
.ax (
matplotlib.axes.Axes
ormatplotlib.gridspec.SubplotSpec
) – If matplotlib Axes object is given, the PPI will be plotted into this axes object. If matplotlib grid definition is given (nrows/ncols/plotnumber), axis are created in the specified place. Defaults to ‘111’, only one subplot/axis.func (
str
) – Name of plotting function to be used under the hood. Defaults to ‘pcolormesh’. ‘contour’ and ‘contourf’ can be selected too.cmap (
str
) – matplotlib colormap string
- Returns
pm (
matplotlib.collections.QuadMesh
ormatplotlib.contour.QuadContourSet
) – The result of the plotting function. Necessary, if you want to add a colorbar to the plot.
Note
If
crs
contains a curvelinear grid dict, thecgax
- curvelinear Axes (r-theta-grid) is returned.caax
- Cartesian Axes (x-y-grid) andpaax
- parasite axes object for plotting polar data can be derived like this:caax = cgax.parasites[0] paax = cgax.parasites[1]
The function
create_cg
uses the Matplotlib AXISARTIST namespace.Here are some limitations to normal Matplotlib Axes (see AXES_GRID1).
Examples
See Quick-view a sweep in polar or cartesian reference systems, and Plot on curvelinear grid.