配合一個主題
你可能已經有一套想在 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() %>%
___(___, ___)