library(ggplot2) ID <- 1:600 values <- c(rnorm(150, mean=25, sd=5), rnorm(150, mean=30, sd=4), rnorm(150, mean=15, 3), rnorm(150, mean=40, sd=5)) category <- c(rep("blue", 150), rep("red", 150), rep("green", 150), rep("yellow", 150)) df <- data.frame(ID, category, values) baseplot <- ggplot(df, aes(category, values, fill=category)) + geom_boxplot() + scale_fill_manual(values=c("blue", "green", "red", "yellow")) baseplot #remove theme baseplot + theme_void() #predefined theme example1 baseplot + theme_dark() #predefined theme example2 baseplot + theme_classic() #changing the background color of the data area of the plot baseplot + theme(panel.background = element_rect(fill = "lightblue")) #changing the background color of the surrounding area of the plot baseplot + theme(plot.background = element_rect(fill = "lightblue")) #changing the background color of the surrounding area of the plot baseplot + theme(plot.background = element_rect(fill = "lightblue")) #changing the grid baseplot + theme( panel.grid.major = element_line(colour="darkblue", size=0.5, linetype="solid"), panel.grid.minor = element_line(colour="lightblue", size=0.4, linetype="dashed")) #removing the grid baseplot + theme( panel.grid.major = element_blank(), panel.grid.minor = element_blank())