Graphics Reference
In-Depth Information
Figure 6-22. A violin plot with box plot overlaid on it
In this example we layered the objects from the bottom up, starting with the violin, then the box
plot, then the white dot at the median, which is calculated using stat_summary() .
The default range goes from the minimum to maximum data values; the flat ends of the violins
are at the extremes of the data. It's possible to keep the tails, by setting trim=FALSE ( Fig-
ure 6-23 ) :
p + geom_violin(trim = FALSE
FALSE )
Figure 6-23. A violin plot with tails
By default, the violins are scaled so that the total area of each one is the same (if trim=TRUE ,
then it scales what the area wouldbeincluding the tails). Instead of equal areas, you can use
Search WWH ::




Custom Search