python - Seaborn: ValueError: No for Palette ='jet'

标签 python matplotlib seaborn colormap

从 seaborn docs 运行以下示例带参数 palette='jet'

import seaborn as sns
tips = sns.load_dataset("tips")
ax = sns.boxplot(x="day", y="total_bill", hue="smoker", data=tips, palette='jet')
得到以下错误
    172         elif palette.lower() == "jet":
    173             # Paternalism
--> 174             raise ValueError("No.")
    175 
    176         elif palette.startswith("ch:"):

ValueError: No.
jet 出现此错误的原因是什么?调色板?我想知道错误信息是否可以更具体的原因 matplotlib docs声明如下

The often-used jet colormap is included in this set of colormaps. We can see that the values vary widely throughout the colormap, making it a poor choice for representing data for viewers to see perceptually.

最佳答案

Seaborn 不包含 jet 调色板。最好使用 Matplotlib 或使用自定义调色板。
可用的配色方案是
enter image description here

关于python - Seaborn: ValueError: No for Palette ='jet',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67008798/

相关文章:

python - 如何使用反向二进制表示重新索引 numpy 数组?

python - 如何修复此收敛错误? Python 3 统计模型

python - 使用矩阵第一行的值作为 matplotlib.pyplot.imshow 的刻度

python - 如何确定平均线 fiddle 图边缘的 x 值

python - 如何在条形图上添加值标签

python - 在Python中使用计数器来计算斐波那契数

python - 使用 Flask-SQLAlchemy 删除行

python - 如何将自定义排序应用于多索引列

python matplotlib : plotting in another process

python - 通过使用多列进行分组,使用 pandas 创建彩色条形图