修改标题的外观
除了应用预设的 theme,您还可以通过调整不同的样式属性进一步微调图形。提示:您可以复用并覆盖上一个练习中生成的 ilo_plot 变量——当前图已经在右侧窗口中显示。
本练习是课程的一部分
在 Tidyverse 中用数据进行沟通
练习说明
使用自定义的
theme()调用与element_text():- 将文本的字体
family改为"Bookman"。 - 另外,将标题与注释的
color分别改为"gray25"和"gray30"。 - 通过将
size提高到 12,使副标题稍大一些。
- 将文本的字体
交互式实操练习
通过完成这段示例代码来试试这个练习。
ilo_plot <- ilo_plot +
theme_minimal() +
# Customize the "minimal" theme with another custom "theme" call
theme(
text = element_text(___ = ____),
title = element_text(___ = ____),
plot.caption = element_text(___ = ___),
plot.subtitle = element_text(___ = ____)
)
# Render the plot object
ilo_plot