Seaborn: ValueError: No for palette='jet'
Asked Answered
C

1

7

Running the following example from seaborn docs with argument 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')

got the following error

    172         elif palette.lower() == "jet":
    173             # Paternalism
--> 174             raise ValueError("No.")
    175 
    176         elif palette.startswith("ch:"):

ValueError: No.

What's the reason for this error with the jet color palette ? I wonder if the error message can be more specific cause matplotlib docs states the following

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.

Character answered 8/4, 2021 at 17:12 Comment(3)
There's a whole Reddit thread that discusses this reddit.com/r/Python/comments/8psk37/…Tactile
The issue that you just get "No" as an error message, and the fact that it's not very helpful has also been raised as a GitHub issue, with a predictable response.Tactile
@DavidBuck thanks for the references, actually this argument makes total sense "This can have the unfortunate side-effect of highlighting "features" in your data which may not actually exist!"Character
R
1

Seaborn does not contain jet color palette. Better to go with Matplotlib or use custom color palette. The available color schemes are enter image description here

Reginaldreginauld answered 10/7, 2021 at 7:39 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.