Complete the code to apply a minimal theme to a ggplot.
library(ggplot2)
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + [1]()The theme_minimal() function applies a minimalistic theme to the plot, removing background grids and decorations.
Complete the code to change the base font size of a ggplot theme to 16.
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + theme_minimal(base_size = [1])Setting base_size = 16 changes the base font size of the theme to 16 points.
Fix the error in the code to set the plot background color to light blue.
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + theme(plot.background = element_rect(fill = [1]))The color name must be a single word string like 'lightblue'. Spaces or incorrect formats cause errors.
Fill both blanks to customize axis text color and size.
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + theme(axis.text.x = element_text(color = [1], size = [2]))
Setting color = "red" changes the x-axis text color to red, and size = 14 makes the text larger.
Fill all three blanks to create a custom theme with green panel background, no grid lines, and bold axis titles.
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + theme(panel.background = element_rect(fill = [1]), panel.grid.major = [2], axis.title = element_text(face = [3]))
Setting fill = "green" colors the panel background green, element_blank() removes major grid lines, and face = "bold" makes axis titles bold.