You can use the following code to change the background color of the plot in ggplot2:
To change the background color of the panel:
library("ggplot2")
data(mtcars)
ggplot(mtcars,aes(disp, qsec)) + geom_line()+
theme(panel.background = element_rect(fill = 'yellow', colour = 'red'))
To change the background color of the plot and not the panel:
ggplot(mtcars,aes(disp, qsec)) + geom_line()+
theme(plot.background = element_rect(fill = 'yellow', colour = 'red'))