R

Asked • 06/21/19

How do I change the background color of a plot made with ggplot2?

By default, ggplot2 produces plots with a grey background. How do I change the color of the background of the plot?For example, a plot produced by the following code: library(ggplot2) myplot<-ggplot(data=data.frame(a=c(1,2,3), b=c(2,3,4)), aes(x=a, y=b)) + geom_line() myplot

1 Expert Answer

By:

Benjamin B. answered • 06/21/19

Tutor
4.9 (35)

Ecologist with 4 years of R and research experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.