Violin charts can be produced with
ggplot2 thanks to the
geom_violin() function. The first chart of the sery 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