翻转坐标轴
当 x 轴的标签彼此重叠时,通常有两种做法:把标签从水平改为垂直,或直接翻转坐标轴。FiveThirtyEight 的图采用了后者,这样更便于阅读标签。上一练习中您创建的图 titled_plot 已为您加载。
本练习是课程的一部分
Tidyverse 中的分类数据
练习说明
- 翻转 x 轴和 y 轴。
- 移除 x 轴刻度。
交互式实操练习
通过完成这段示例代码来试试这个练习。
flipped_plot <- titled_plot +
# Flip the axes
___ +
# Remove the x-axis ticks and labels
___(___ = element_blank(),
___ = element_blank())