Data Science Desktop Survival Guide
by Graham Williams |
|||||
Violin Plot Embedded Box Plot |
Raw
ds %>%
mutate(year=factor(format(ds$date, "%Y"))) %>% ggplot(aes(x=year, y=max_temp, fill=year)) + geom_violin() + geom_boxplot(width=.5, position=position_dodge(width=0)) + theme(legend.position="none")
We can overlay the violin plot with a box plot to show the quartiles.
|