Add support for histfunc='kde' in px.histogram()
Open
Nobody has claimed this yet.
feature
P3
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
Would be great if the histfunc argument of px.histogram() accepted 'kde'. It's currently limited to ['count', 'sum', 'avg', 'min', 'max'] but I'm looking for output like what figure_factory.create_distplot() gives when show_hist=False, show_rug=False.
import plotly.figure_factory as ff
import numpy as np
x1 = np.random.randn(200) - 1
x2 = np.random.randn(200)
x3 = np.random.randn(200) + 1
hist_data = [x1, x2, x3]
group_labels = ['Group 1', 'Group 2', 'Group 3']
colors = ['#333F44', '#37AA9C', '#94F3E4']
# Create distplot with curve_type set to 'normal'
fig = ff.create_distplot(hist_data, group_labels, show_hist=False, show_rug=False, colors=colors)
# Add title
fig.update_layout(title_text='Curve and Rug Plot')
fig.show()

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at px.histogram() and its histfunc handling, then compare the requested output with figure_factory.create_distplot() using show_hist=False and show_rug=False. Determine how KDE should be represented and make done mean that histfunc='kde' produces the requested curve behavior for grouped data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100