Skip to content

Infer brewer palette types from names - #1123

Merged
has2k1 merged 1 commit into
mainfrom
fix-brewer-named-palette-type
Sep 7, 2026
Merged

has2k1 merged 1 commit into
mainfrom
fix-brewer-named-palette-type

Conversation

@has2k1

@has2k1 has2k1 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

This PR makes scale_color_brewer and scale_fill_brewer infer the palette type from its name, so scale_color_brewer(palette="Set2") works without an explicit type.

scale_color_distiller and scale_fill_distiller now warn when interpolating a qualitative palette regardless of whether the type comes from the palette name or the type argument.

It also bumps the mizani dependency to 0.14.5, which this fix requires.

closes #1048

Named Brewer palettes now determine their own type, while numeric palettes continue to use the requested type. Unknown names raise ValueError, and scale_color_brewer(palette="Set2") works without an explicit qualitative type. The dependency update requires mizani 0.14.5.

Warn when scale_color_distiller interpolates a qualitative palette, regardless of whether its type comes from the palette name or the type argument.
@has2k1
has2k1 merged commit 8aa2879 into main Sep 7, 2026
14 checks passed
@has2k1
has2k1 deleted the fix-brewer-named-palette-type branch September 7, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scale_color/fill_brewer() --- allow user to pass palette without specifying type

1 participant