將資料欄位對應到視覺屬性(aesthetics)
接下來更深入看看本課程的三個重點:資料、視覺屬性(aesthetics),以及幾何層(geom)。在最後一章會搭配主題(themes)層,帶你做出更美觀的圖表。
我們會繼續使用 mtcars 資料框中的 32 輛車。
在學習這些範例與概念時,想一想要如何套用到你自己的資料集上!
本練習屬於課程
ggplot2 資料視覺化入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Edit to add a color aesthetic mapped to disp
ggplot(mtcars, aes(wt, mpg)) +
geom_point()