Skip to content

Plotting methods #9348

Open
Open
@eni-awowale

Description

@eni-awowale

What is your issue?

From @TomNicholas

It would be nice to have plotting methods that allow for easily comparing variables in different parts of a tree.

One simple way would be to have a dt.plot(variable, **kwargs) method which uses a legend to distinguish between variables, i.e.

def plot(self, variable, **kwargs):
fig, ax = plt.subplots()

for node in self.subtree:
    da = node[variable]
    da.plot(ax=ax, label=node.name, **kwargs)

ax.legend()
ax.set_title(variable)
plt.show()

The use cases for this would be multi-resolution datasets, or multi-model ensembles, where the user wants to see how a single variable varies across different datasets.

Care would have to be taken to ensure that incompatible dimensions or coordinates were handled smoothly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions