I am trying to find source code to create violin plots in Matlab. Functionality does not exist in the statistics toolbox nor does a simple Google result in anything useful.
This function creates simple violin plots by estimating the kernel density, using matlabs default ksdensity(). Given a matrix or table with m columns, you will get violins for each of the columns. Key Features: a) Specify plotting features as facecolor, edgecolor, etc.
A violin plot is more informative than a plain box plot. While a box plot only shows summary statistics such as mean/median and interquartile ranges, the violin plot shows the full distribution of the data. The difference is particularly useful when the data distribution is multimodal (more than one peak).
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.
By default, box plots show data points outside 1.5 * the inter-quartile range as outliers above or below the whiskers whereas violin plots show the whole range of the data.
Have a look at DISTRIBUTIONPLOT. I apologize for the name: I called the function like that because I didn't know that they were otherwise known as violin plots at the time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With