目前我正在使用命令
plt.errorbar(X,Y,yerr=myYerr, fmt="o", alpha=0.5,capsize=4)
我得到默認標記顏色:

但是我應該怎么做才能強制 matplotlib 對色盲更友好?
uj5u.com熱心網友回復:
根據這個 [1] 您可以使用預定義的色盲樣式。它應該很簡單:
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
[1] https://matplotlib.org/stable/users/prev_whats_new/whats_new_2.2.html#new-style-colorblind-friendly-color-cycle
還可以查看此鏈接中的最后一張圖片:
https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/354229.html
標籤:Python matplotlib 阴谋 颜色 可达性
