holoviz / holoviz/hvplot

by argument not working for hist plot

Open
#865 3 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

I'm working on updating the docstrings for the `hist` plot. I would expect the `by` argument to work similarly to how it works for other hvPlot plots and/ or similarly to how it works for Pandas plot https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.hist.html.

![image](https://user-images.githubusercontent.com/42288570/186918764-5a70292c-fc4b-4562-acbd-98c9269eb69f.png)

But it seems to have no effect.

## With `by`

![image](https://user-images.githubusercontent.com/42288570/186919195-ff6f8d5a-d894-4308-b90d-6fb68e2f0a65.png)

```python
import hvplot.pandas # noqa
import pandas as pd
import numpy as np
age_list = [8, 10, 12, 14, 72, 74, 76, 78, 20, 25, 30, 35, 60, 85]
df = pd.DataFrame({"gender": list("MMMMMMMMFFFFFF"), "age": age_list})
df.hvplot.hist(y=["age"], by="gender")
```

## Without `by`

![image](https://user-images.githubusercontent.com/42288570/186919317-c127f7c7-454b-4ae8-8390-90cda741e7b6.png)

```python
import hvplot.pandas # noqa
import pandas as pd
import numpy as np
age_list = [8, 10, 12, 14, 72, 74, 76, 78, 20, 25, 30, 35, 60, 85]
df = pd.DataFrame({"gender": list("MMMMMMMMFFFFFF"), "age": age_list})
df.hvplot.hist(y=["age"])
```

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.