匹配主题
您可能已经有一套想在 plotly 中复用的作图主题。比如,您可能更喜欢时间序列图具备:
- 只显示水平网格线
- 图形周围为浅灰色背景(
#ebebeb)
本练习中,您的任务是将 1980–2016 年全球电子游戏销量的时间序列图调整为满足上述要求。
注意:已为您加载 plotly。
本练习是课程的一部分
R 中的 plotly 交互式数据可视化
练习说明
- 通过更改
xaxis选项移除垂直网格线。 - 将背景颜色设置为
"#ebebeb"。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Set the background color to #ebebeb and remove the vertical grid
annual_vgsales %>%
plot_ly(x = ~Year, y = ~Global_Sales) %>%
add_lines() %>%
___(___, ___)