修正标签
当前的初始图能展示数据,但离 FiveThirtyEight 的成图还有不少差距。先从图形上下及周围的文字开始调整。我们已经看到 ggplot2 的 labs() 图层可以通过多个参数来修改文本。上一练习中您创建的图形 initial_plot 已为您加载。
本练习是课程的一部分
Tidyverse 中的分类数据
练习说明
- 为了与 FiveThirtyEight 图一致:
- 添加标题、副标题和署名信息(caption)
- 将 x、y 轴的标签设为空字符串
- 将其保存为新图
titled_plot。
交互式实操练习
通过完成这段示例代码来试试这个练习。
titled_plot <- initial_plot +
# Add the title, subtitle, and caption
___(___ = "Hell Is Other People In A Pressurized Metal Tube",
___ = "Percentage of 874 air-passenger respondents who said action is very or somewhat rude",
___ = "Source: SurveyMonkey Audience",
# Remove the x- and y-axis labels
__ = "",
__ = "")
titled_plot