[Go to site: main page, start]

Basic ggplot2 boxplot



A boxplot summarizes the distribution of a continuous variable. It displays its median, its first and third quartiles and its outliers. Main caveat is that the underlying distribution is hidden. This page explains how to build a basic boxplot with ggplot2.

Boxplot Section Boxplot pitfalls

The ggplot2 library allows to make a boxplot using geom_boxplot(). You have to specify a quantitative variable for the Y axis, and a qualitative variable for the X axis ( a group).

Related chart types


Violin
Density
Histogram
Boxplot
Ridgeline



❤️ 10 best R tricks ❤️

👋 After crafting hundreds of R charts over 12 years, I've distilled my top 10 tips and tricks. Receive them via email! One insight per day for the next 10 days! 🔥