holoviz / holoviz/hvplot

Explorer plot code is invalid for a KDE plot using the 'by' parameter

Open
#972 1 comment 0 reactions 0 assignees View on GitHub
api: explorer
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

#### ALL software version info
hvplot==0.8.1
jupyterlab==3.4.4
pandas==1.4.3

#### Description of expected behavior and the observed behavior

Plot code that is returned from hvplot.explorer.plot_code() is invalid for a KDE plot using the by argument.

#### MVCE

```python
df = pd.read_csv('pokemon.csv')
explorer = hvplot.explorer(df)
explorer

explorer.plot_code()
>>> "df.hvplot(by=['Generation'], kind='kde', y=['Attack'])"

# this plot seems to ignore the 'by' keyword
df.hvplot(by=['Generation'], kind='kde', y=['Attack'])

# If the y keyword changes from list to single string, a correct plot is obtained
df.hvplot(by=['Generation'], kind='kde', y='Attack')
```

![image](https://user-images.githubusercontent.com/118738900/203059558-fcc74951-568d-48dc-8519-1e163bdc644c.png)

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.