Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

Boxplot is probably one of the most common type of graphic. It gives a nice summary of one or several numeric variables. The line that divides the box into 2 parts represents the median

of the data. The end of the box shows the upper and lower quartiles. The extreme lines shows the highest and lowest value excluding outliers. Note that boxplot hide the number of values

existing behind the variable. Thus, it is highly advised to print the number of observation, add unique observation with jitter or use a violinplot if you have many observations.

Sponsors


 

Ggplot2


Ggplot2 is definitely the best way to build your boxplot with R. It provides all the customisation you can need through the geom_boxplot() utility. A lot of tricks are described: how to control the color, how to sort groups and control their width, how to show average values and more.

Base R


The boxplot function allows to build boxplots in baseR. Here are a couple of examples illustrating how to use this function.

Related