Violin charts can be produced with
ggplot2 thanks to the
geom_violin() function. The first chart of the series below describes its basic utilization and explain how to build violin chart from different input format.
Most basic violin chart
Most basic violin using default parameters.
Focus on the 2 input formats you can have: long and wide
Control group order
Changing group order in your violin chart is important. It adds insight to the chart. Learn why and discover 3 methods to do so.
Flipping X and Y axis allows to get a horizontal version. Group labels become much more readable
Violin + boxplot + sample size
This examples provides 2 tricks: one to add a boxplot into the violin, the other to add sample size of each group on the X axis
It is doable to plot a violin chart using base R and the
The web is full of astonishing R charts made by awesome bloggers. The R graph gallery tries to display some of the best creations and explain how their source code works. If you want to display your work here, please drop me a word or even better, submit a Pull Request!