easyclimate.plot.mpas.cell_voronoi¶
Voronoi-style plots for MPAS cells.
Functions¶
|
Plot MPAS cell-centered scalar field on native polygon cells. |
Module Contents¶
- easyclimate.plot.mpas.cell_voronoi.plot_cell_voronoi(ds, da, *, ax=None, transform=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, cell_margin=0.05, global_plot=False, input_radians=True, center_lon=None, skip_large_lon_jump=True, max_polygon_lon_span=180.0, cmap=None, vmin=None, vmax=None, symmetric=False, percentile=98, edgecolor='none', linewidth=0.0, add_colorbar=True, cbar_kwargs=None, title=None, xlabel='Longitude', ylabel='Latitude', aspect='auto', lon_name_cell='lonCell', lat_name_cell='latCell', lon_name_vertex='lonVertex', lat_name_vertex='latVertex', vertices_on_cell_name='verticesOnCell', n_edges_on_cell_name='nEdgesOnCell', use_geometry_cache=True)¶
Plot MPAS cell-centered scalar field on native polygon cells.
The scalar field is rendered on each native MPAS cell polygon. The function works with both plain Matplotlib axes and Cartopy GeoAxes.
Parameters¶
- ds
xarray.Dataset Dataset containing MPAS mesh geometry.
- da
xarray.DataArrayornumpy.ndarray Cell-centered scalar field. Must be 1D on nCells after selection.
- ax
matplotlib.axes.Axes, optional Axes on which to draw. By default, use the current axes.
- projection
cartopy.crs.CRS, optional Reserved for compatibility with older call sites.
- transform
cartopy.crs.CRS, optional Coordinate reference system of the input coordinates for Cartopy axes.
- lon_min, lon_max, lat_min, lat_max
float, optional Plot extent. Cross-dateline windows are supported, for example:
lon_min=-190, lon_max=-60describes the continuous longitude window from 170E to 60W.- auto_extent
bool, default: True If True and no explicit extent is supplied, infer the extent from valid cell centers.
- extent_margin
float, default: 0.05 Fractional margin added to the automatically inferred extent.
- cell_margin
float, default: 0.05 Extra fraction of the plot extent used to select cells outside the visible window. This helps avoid missing partial cells along boundaries.
- global_plot
bool, default: False If True, draw a global extent centered on
center_lon.- input_radians
bool, default: True If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.
- center_lon
float, optional Longitude wrapping center. If None, inferred from lon_min/lon_max or valid cell centers.
- skip_large_lon_jump
bool, default: True If True, skip polygons with very large wrapped longitude spans.
- max_polygon_lon_span
float, default: 180.0 Maximum accepted wrapped polygon longitude span in degrees.
- cmap
strormatplotlib.colors.Colormap, optional Colormap used for cell values.
- vmin, vmax
float, optional Color limits. If omitted, infer them from selected values.
- symmetric
bool, default: False If True, infer symmetric color limits around zero.
- percentile
float, default: 98 Percentile used for automatic color-limit inference.
- edgecolor, linewidth
Polygon edge style passed to
matplotlib.collections.PolyCollection.- add_colorbar
bool, default: True If True, add a colorbar for the polygon collection.
- cbar_kwargs
dict, optional Keyword arguments passed to
Figure.colorbar.- title
str, optional Axes title. If None, use the data long name.
- figsize(
float,float), default: (8, 6) Reserved for compatibility with older call sites.
- xlabel, ylabel
str Axis labels used for plain Matplotlib axes.
- aspect
strorfloat, default: “auto” Aspect setting used for plain Matplotlib axes.
- lon_name_cell, lat_name_cell, lon_name_vertex, lat_name_vertex
str MPAS coordinate variable names.
- vertices_on_cell_name, n_edges_on_cell_name
str MPAS connectivity variable names.
- use_geometry_cache
bool, default: True If True, cache native cell polygon geometry for repeated calls.
Returns¶
- ax
matplotlib.axes.Axes Axes containing the plot.
- pc
matplotlib.collections.PolyCollection Polygon collection added to the axes.
- ds