Enhance hv.Distribution to natively support ridgeline plots
See original GitHub issueProposal
Creating joyplots with Holoviews should not be too complicated using hv.Distribution
with hv.Layout
or hv.Overlay
(or hv.NdOverlay
). However, it would be great to abstract away the implementation within hv.Distribution
.
joy_index
In the same way as hv.Bars
has two variants via group_index
and stack_index
to distinguish groups of data, hv.Distribution
could support an optional joy_index
to distinguish different distributions. Using the joy_index
option would automatically result in joy plots. color_index
and cmap
could be added for coloring different groups as in the referenced example above.
I think a group_index
(or better overlay_index
) could be also possible to simply overlay different distributions without distinguishing them vertically (as in joyplots) and without explicitly using overlays.
What is your opinion on this? I would be willing to give it a shot if you find this enhancement useful and appropriate. I took a quick look at the code and recognized the Compositor
in combination with univariate_kde
and Area
. I have to get my head around the design here but it should be ok.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top GitHub Comments
It doesn’t seem too difficult to add such a plot, given https://bokeh.pydata.org/en/latest/docs/gallery/ridgeplot.html ; PRs welcome!
But note that to keep the library neutral, it should be called Ridgeline and not Joy…
I would love to see joy plots too. Your suggestion of a joy_index seems reasonable although I would also consider a
Ridgeline
orJoy
element where the key dimension is the joy_index and the value dimension the values to compute the kdes over. In general I think we want to move away fromindex
options in favor of making the dimension explicit or express it using op transforms (https://github.com/ioam/holoviews/pull/2152).