-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
For demo notebooks or in a student thesis it can be nice to show the catchment that is being modeled on a map. This would reduce the clutter and can implement a consistent and clean API to plot.
Something like;
def plot_catchment(
shape: Path | str,
lat_bounds: tuple[float, float] | None,
lon_bounds: tuple[float, float] | None,
ax: matplotlib.axis.Axis | None,
) -> tuple[matplotlib.figure.Figure, matplotlib.axis.Axis] | None:
# Load shape / geometry
if ax:
# plot in existing axis
else:
# create cartopy mat plot, add shapefile
# also add country borders, coastline, sea, rivers.
if lat_bounds and lon_bounds:
# apply bounds (set_xlim, set_ylim)
else:
# infer appropriate bounds, apply
if ax is None:
return fig, axis # return figure and axis so users can add to/modify plotMetadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request