開始使用免費開始

翻轉座標軸 II

在這個練習中,我們會繼續使用 coord_flip() 圖層函式,將映射到 xy 美學屬性的變數對調。

mtcars 資料集裡,car 是車款名稱,wt 是車重。

本練習屬於課程

ggplot2 中級資料視覺化

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Plot of wt vs. car
___ +
  # Add a point layer
  ___ +
  labs(x = "car", y = "weight")
編輯並執行程式碼