Recall & Review
beginner
What is a theme in R plotting?
A theme in R plotting controls the overall appearance of a plot, including colors, fonts, background, grid lines, and other visual elements.
Click to reveal answer
beginner
How do you apply a built-in theme to a ggplot2 plot?
Use the
+ theme_name() function after your plot code, for example, + theme_minimal() applies the minimal theme.Click to reveal answer
intermediate
What function is used to customize individual theme elements in ggplot2?
The
theme() function lets you customize specific parts like text size, axis lines, legend position, and more.Click to reveal answer
intermediate
How can you change the font size of axis titles in a ggplot2 theme?
Inside
theme(), use axis.title = element_text(size = value) where value is the font size number.Click to reveal answer
intermediate
What is the benefit of creating a custom theme in ggplot2?
A custom theme lets you reuse your preferred style across many plots, saving time and keeping your visuals consistent.
Click to reveal answer
Which function applies a built-in theme in ggplot2?
✗ Incorrect
The function
theme_minimal() is a built-in ggplot2 theme that can be added to a plot.How do you change the background color of a plot using theme()?
✗ Incorrect
Use
panel.background = element_rect(fill = 'color') inside theme() to change the plot background.What does
element_text() control in a theme?✗ Incorrect
element_text() controls text properties such as size, color, and font.Which of these is NOT a built-in ggplot2 theme?
✗ Incorrect
theme_bright() is not a standard ggplot2 theme.Why create a custom theme in ggplot2?
✗ Incorrect
Custom themes help keep a consistent look and save time by reusing style settings.
Explain how to customize the appearance of a ggplot2 plot using themes.
Think about how you change colors, fonts, and backgrounds in your plots.
You got /4 concepts.
Describe the advantages of creating and using a custom theme in R plotting.
Consider why you might want all your plots to look similar without repeating code.
You got /4 concepts.