midlearn.scale_color_theme
- midlearn.scale_color_theme(theme: str | list[str] | color_theme, midpoint: float = 0, **kwargs) scale_color_theme_d | scale_color_theme_c [source]
Scale for ‘color’ aesthetics of plotnine graphics.
Generate either a discrete or continuous color scale depending on the theme type.
- Parameters:
theme (str or list of str or color_theme) – The name of the theme (str), a list of custom colors (list[str]), or an existing color_theme object.
midpoint (float, default 0) – The value used as the center for the ‘diverging’ color scale.
**kwargs (dict) – Additional keyword arguments passed to the constructor of scales.
- Returns:
A plotnine color scale object based on the theme’s type.
- Return type:
scale_color_theme_d or scale_color_theme_c
See also
scale_fill_theme
The corresponding scale function for the ‘fill’ aesthetic.
Notes
If the theme is ‘qualitative’, it returns
scale_color_theme_d
. Otherwise, it returnsscale_color_theme_c
.