question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support violin plot and probability density plots

See original GitHub issue

From 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 (and density 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.
  • 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:open
  • Created 6 years ago
  • Reactions:18
  • Comments:29 (22 by maintainers)

github_iconTop GitHub Comments

8reactions
kanitwcommented, May 30, 2019

Btw, I run into a “split violin plot” in seaborn. It’s definitely worth considering how this fits into our grammar.

image

5reactions
domoritzcommented, Mar 29, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Violin Plots 101: Visualizing Distribution and Probability Density
Unlike a box plot that can only show summary statistics, violin plots depict summary statistics and the density of each variable.
Read more >
A Complete Guide to Violin Plots | Tutorial by Chartio
Violin plots are used to compare the distribution of data between groups. Learn how violin plots are constructed and how to use them...
Read more >
How to Interpret Violin Plots - LabXchange
A violin plot is a boxplot with a probability density function (PDF) added on top of it. A PDF is essentially a smoothed...
Read more >
Violin plots explained - Towards Data Science
In general, violin plots are a method of plotting numeric data and can be considered a combination of the box plot with a...
Read more >
Violin plots for services & kanban - Robert Falkowitz
No, a violin plot is a graphic representation of the probability density of a sample of data. Derived from the box plot, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found