gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 13:27:57 26 4
gpt4 key购买 nike

从 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com