ComeçarComece de graça

Alter background color and add margins

Further customize the look of your plot with more arguments to the theme function call. You can continue working on your ilo_plot object created in the last exercise.

Este exercício faz parte do curso

Communicating with Data in the Tidyverse

Ver curso

Instruções do exercício

  • Change the overall background color of your plot to "gray95".
    • This time, another function than element_text is needed – one for rectangular plot elements. Rewatch the video to know which.
  • Add margins to the plot: 5mm top and bottom, 10mm to the left and the right.
  • The margins need to be specified in the following order: top, right, bottom, and left.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

ilo_plot +
  # "theme" calls can be stacked upon each other, so this is already the third call of "theme"
  theme(
    plot.background = ___(fill = ___),
    plot.margin = unit(c(___, ___, ___, ___), units = "mm")
  )
Editar e executar o código