You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the example above I would expect all three figures to look like the expected file, but the following behavior is observed:
a1 - _base.py:274, numeric_mapping() ignores previously set palette completely and doesn't even try to retrieve any previously set values
a2 - same thing here
a3 - this one works, but _base.py:208 sets the map_type as categorical. That is correct in this case (and for my use-case as well) but I'm not sure about the implications for different data. Well, that's not really a part of this bug report in any case.
I would expect seaborn to handle numeric hue columns so that the result is the same as the second attached figure, generated by a3.
I tried replacing
palette = "ch:" if palette is None else palette
if isinstance(palette, mpl.colors.Colormap):
cmap = palette
else:
cmap = color_palette(palette, as_cmap=True)
with something similar to the code in categorical_mapping() but that didn't work because the retrieved structure was a list (or _ColorPalette without as_cmap) and cmap needs to be callable while creating the lookup_table.
SW: Seaborn 0.13.2, Matplotlib 3.8.3
The text was updated successfully, but these errors were encountered:
This is expected behavior; the global matplotlib color cycle is used for categorical data, but in most cases it would not make sense to use it for the continuous mapping applied to numeric data.
Because seaborn is currently limited to the global configuration that matplotlib offers, and matplotlib does not distinguish between discrete and continuous color defaults, there's currently no way to set the default palette for numeric data. Although there is already an issue tracking this: #2606
Despite setting
colorblind
palette globally, seaborn still usesch:
. From the following snippet, onlya3
works as expectedMRE:
Observed output:
Expected output:
For the example above I would expect all three figures to look like the expected file, but the following behavior is observed:
a1 - _base.py:274,
numeric_mapping()
ignores previously set palette completely and doesn't even try to retrieve any previously set valuesa2 - same thing here
a3 - this one works, but _base.py:208 sets the
map_type
as categorical. That is correct in this case (and for my use-case as well) but I'm not sure about the implications for different data. Well, that's not really a part of this bug report in any case.I would expect seaborn to handle numeric hue columns so that the result is the same as the second attached figure, generated by
a3
.I tried replacing
with something similar to the code in
categorical_mapping()
but that didn't work because the retrieved structure was a list (or_ColorPalette
withoutas_cmap
) andcmap
needs to be callable while creating thelookup_table
.SW: Seaborn 0.13.2, Matplotlib 3.8.3
The text was updated successfully, but these errors were encountered: