Boxplot Basics in ggplot2 Basic Syntax library(ggplot2) ggplot(mtcars,aes(factor(vs),mpg))+geom_boxplot() Additional Features Add Colors ggplot(mtcars,aes(factor(vs),mpg,fill=factor(vs)))+geom_boxplot() Multiple Groups ggplot(mtcars,aes(factor(vs),mpg,fill=factor(am)))+geom_boxplot() Edit Width/Spacing ggplot(mtcars,aes(factor(vs),mpg,fill=factor(am)))+ geom_boxplot(width=0.4, # Controls Width of Boxes position=position_dodge(0.5), # Controls Space between Boxes size=1.2) # Controls Whisker Thickness Changing Themes Modify Axes standard_theme <- theme(axis.text.x=element_text(size=14), # Change x-axis value text-size axis.title.x=element_text(size=18), # Change x-axis label text-size axis.text.y=element_text(size=14), # Change y-axis value text-size axis.title.y=element_text(size=18), # Change y-axis label text-size legend.text=element_text(size=14), # Change legend value text-size legend.title=element_text(size=16)) # Change legend title text-size ggplot(mtcars,aes(factor(vs),mpg,fill=factor(am)))+ geom_boxplot(width=0.4, position=position_dodge(0.5), size=1.2)+ scale_x_discrete('VS')+ scale_y_continuous('Miles Per Gallon (MPG)')+ scale_fill_discrete('AM')+ standard_theme More Resources Source as RMarkdown docs.ggplot2.org