視覺化中的色彩

用 Python 改善你的資料視覺化

Nick Strayer

Instructor

色彩的用法

  • 區分資料類別
  • 編碼連續數值
  • 需_謹慎_使用

彩色緞帶

用 Python 改善你的資料視覺化

色彩可以很美

  • 單調 → 吸睛

  • 多樣更好

灰階地圖與藍色彩地圖對照

用 Python 改善你的資料視覺化
  • 色彩的意義常受文化與個人經驗影響 2016 年選舉的 New York Times 選舉地圖
1 Parlapiano, A. (2016 November 1) There are many ways to map election results. We've tried most of them. New York Times. Retrieved from https://www.nytimes.com/
用 Python 改善你的資料視覺化

長條圖顯示不同的色彩偏好

用 Python 改善你的資料視覺化

色彩可能誤導…

「不論採用何種排列方式,色彩—尺寸錯覺都明顯存在。」

C.J. Warden & E.L. Flynn, 1926

不同大小與顏色的紙箱

用 Python 改善你的資料視覺化

修正色彩—尺寸錯覺的方法

sns.barplot(x = values, y = ids)

  彩虹色無邊框長條圖

sns.barplot(x = values, y = ids, 
            edgecolor = 'black')

彩虹色長條附黑色外框

用 Python 改善你的資料視覺化
sns.barplot(x = values, y = ids, color = 'cadetblue')

全為藍色的長條圖

用 Python 改善你的資料視覺化

來為資料上色吧!

用 Python 改善你的資料視覺化

Preparing Video For Download...