xarray-contrib / datatree

WIP implementation of a tree-like hierarchical data structure for xarray.
https://xarray-datatree.readthedocs.io
Apache License 2.0
161 stars 43 forks source link

Auto-plotting capabilities #336

Open eschalkargans opened 1 month ago

eschalkargans commented 1 month ago

Motive

Xarray is already capable of smart plotting data arrays and in some extents, datasets.

Xarray has limited support for plotting Dataset variables against each other.

https://docs.xarray.dev/en/latest/user-guide/plotting.html

Suggestion

The rich display tree structure could be reused with a default .plot() call inside of it, for example.

However, it is also a change that would concern Datasets themselves as there is no way currently plot all the variables of a Dataset.

Experience feedback: oftentimes I convert a Dataset to a DataArray with ds.to_array() for plotting with facets. This is possible when variables of the dataset have the same dimensions.