pydata / pydata/xarray

Plotting methods

Open
#9,348 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design question enhancement topic-DataTree
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the proposed dt.plot entry point and inspect how node[variable] and da.plot are expected to work across the tree. Define completion as comparing one variable across nodes with a legend and title while handling incompatible dimensions or coordinates smoothly; no file or test is identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.