Sam
Sam

Reputation: 8182

How do I draw a violin plot using ggplot2?

Can I use ggplot2 to produce a violin plot? Perhaps using some variation of geom_boxplot()?

Upvotes: 18

Views: 7850

Answers (2)

Ari B. Friedman
Ari B. Friedman

Reputation: 72741

A quick googling returns this site, which uses geom_ribbon to draw violin plots for Figure 3.14.

Note to anyone catching up

As @Ben points out below, geom_violin() is now the preferred method for producing violin plots in ggplot2.

Upvotes: 5

Ben
Ben

Reputation: 42283

Version 0.9.0 includes the geom_violin: http://docs.ggplot2.org/current/geom_violin.html

Upvotes: 30

Related Questions