holoviz / holoviz/hvplot

xarray data with multi-index coordinates can not be plotted

Open
#1,204 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

`hvplot` , 0.9.0 leads to an exception, while `plot` generates the correct plot for Xarray datasets/data arrays with multiindexed coordinates:

There are a few Multi-indexed issues reported #351, #1036. I am not sure if multi-indexed data is supported at all with hvplot?

minimum example, where `plot` works, but `hvplot` leads to an exception

```
import pandas as pd
import numpy as np
import xarray as xr
import hvplot.xarray

midx = pd.MultiIndex.from_product([[2,4,6], [0, 1]], names=("one", "two"))

mda = xr.DataArray(np.random.rand(6, 3), [("x", midx), ("y", range(3))])

mda.plot(x="one")

mda.hvplot(x="one")

```

![image](https://github.com/holoviz/hvplot/assets/3274852/eed060e0-3666-420d-afc7-9ced6802bf45)

![image](https://github.com/holoviz/hvplot/assets/3274852/6767041c-9d13-4371-86bc-ed7d8862c04f)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.