美學最佳實務

ggplot2 資料視覺化入門

Rick Scavetta

Founder, Scavetta Academy

該用哪些視覺屬性?

  • 發揮你的創意專長,並且
  • 遵循明確準則
  • Jacques Bertin
    • The Semiology of Graphics, 1967
  • William Cleveland
    • The Elements of Graphing Data, 1985
    • Visualizing Data, 1993
ggplot2 資料視覺化入門

形式服膺功能

ggplot2 資料視覺化入門

形式服膺功能

功能

主要:

  • 準確且高效的呈現

次要:

  • 美觀、吸睛的圖表

指導原則

避免:

  • 曲解或遮蔽資料
  • 以複雜度讓觀者困惑

務必:

  • 針對每張圖的受眾與目的來設計
ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

從資料擷取資訊

ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

最佳視覺屬性選擇

  • 高效率
    • 比數值摘要更快掌握全貌
  • 高準確
    • 降低資訊流失
ggplot2 資料視覺化入門

視覺屬性-連續變數

ggplot(iris, aes(x = Sepal.Length,
                 y = Sepal.Width,
                 color = Species)) + 
  geom_point()

ggplot2 資料視覺化入門

視覺屬性-連續變數

ggplot(iris, aes(color = Sepal.Length,
                 y = Sepal.Width,
                 x = Species)) + 
  geom_point()

ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

三張 iris 散佈圖

ggplot2 資料視覺化入門

三張 iris 散佈圖,y 軸不對齊

ggplot2 資料視覺化入門

單一分面圖,共用 y 軸

ggplot2 資料視覺化入門

ggplot2 資料視覺化入門

視覺屬性-類別變數

ggplot(iris, aes(x = Sepal.Length,
                 y = Sepal.Width, 
                 col = Species)) + 
  geom_point()

ggplot2 資料視覺化入門

視覺屬性-類別變數

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width, 
                 col = Species)) + 
  geom_point(position = "jitter", 
             alpha = 0.5)

ggplot2 資料視覺化入門

換你試試看

ggplot2 資料視覺化入門

Preparing Video For Download...