Skip to content

Add axes parameter to plot methods #175

@mx-moth

Description

@mx-moth

I was trying to make a plot that combined a surface plot showing the model grid and a transect line, next to a transect plot of that line. In matplotlib this can be created with multiple axes in one figure, using gridspec or similar. Neither the surface plot method nor the transect plot method accept an axes parameter - they assume they are the only plot on a figure.

Feature suggestion: Add an axes parameter to the plot methods:

def plot_on_figure(
    figure: matplotlib.figure.Figure,
    # ...
    axes: matplotlib.axes.Axes | None = None,
):
    if axes is None:
        axes = figure.subplots(projection=dataset.ems.data_crs)
    # ...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions