Support violin plot and probability density plots
See original GitHub issueFrom https://vega.github.io/vega/examples/violin-plot/
A violin plot visualizes a distribution of quantitative values as a continuous approximation of the probability density function, computed using kernel density estimation (KDE). The densities are additionally annotated with the median value and interquartile range, shown as black lines. Violin plots can be more informative than classical box plots.
https://vega.github.io/vega/examples/probability-density/ is another related example
-
Understand https://vega.github.io/vega/examples/violin-plot/ and https://vega.github.io/vega/examples/probability-density/ examples throughly, search online to understand other violin and density plot variants, and define the scope that we want to support.
-
Understand how we implement composite mark thoroughly by looking at the [box-plot codebase](https://github.com/vega/vega-lite/blob/master/src/compositemark/boxplot.ts. (By summer, we should have reasonable
error-bar
example as well.) -
Design
density
transform in Vega-Lite and see if we can already use area mark to reproduce the density area for violin. -
Design composite mark syntax for
violin
(anddensity
plot?)- First we can focus on just the violin area part: design MarkDefinition block for Violin so that we can define property of the underlying
density
transform and other related properties - Decide if we need a composite mark for density plot – (probably yes), and make sure that the syntax for violin and density are consistent. (Also think if there is a better name for
density
too) - For violin plot, we need to decide if we want to include interquartile range and median as a part of the violin composite mark (which is sort of like the “box” overlay on top of violin plot). The syntax here should be very consistent with box-plot.
- First we can focus on just the violin area part: design MarkDefinition block for Violin so that we can define property of the underlying
-
Implement the code. Note that there is probably a good way to share at least some part of the implementation between the violin and density plot.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:18
- Comments:29 (22 by maintainers)
Top GitHub Comments
Btw, I run into a “split violin plot” in seaborn. It’s definitely worth considering how this fits into our grammar.
We’ve had this transform for a while but it does not support faceting and that’s a deal breaker. We’ve come to the conclusion that we need a kde transform that has a group by key.