BS5¶
ggsci.palettes
¶
Palette generators for ggsci.
This module provides palette functions that either return a callable for discrete palettes or a sequence of colors for continuous palettes.
pal_bs5(palette='blue', n=10, alpha=1.0, reverse=False)
¶
Bootstrap 5 color palette (continuous/sequential).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
palette
|
str
|
Palette name: "blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", or "gray". |
'blue'
|
n
|
int
|
Number of colors to generate. |
10
|
alpha
|
float
|
Transparency level, between 0 and 1. |
1.0
|
reverse
|
bool
|
Whether to reverse the color order. |
False
|
Returns:
Type | Description |
---|---|
Sequence[str]
|
A sequence of hex color codes. |
Raises:
Type | Description |
---|---|
ValueError
|
If the palette name is unknown or alpha is invalid. |
ggsci.scales
¶
Plotnine scales for ggsci palettes.
scale_colour_bs5 = scale_color_bs5
module-attribute
¶
scale_color_bs5(palette='blue', *, alpha=1.0, reverse=False, **kwargs)
¶
Bootstrap 5 color scale (continuous/sequential).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
palette
|
str
|
Palette name: "blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", or "gray". |
'blue'
|
alpha
|
float
|
Transparency level, between 0 and 1. |
1.0
|
reverse
|
bool
|
Whether to reverse the color order. |
False
|
**kwargs
|
Any
|
Additional keyword arguments forwarded to plotnine.scale_color_gradientn. |
{}
|
scale_fill_bs5(palette='blue', *, alpha=1.0, reverse=False, **kwargs)
¶
Bootstrap 5 fill scale (continuous/sequential).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
palette
|
str
|
Palette name: "blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", or "gray". |
'blue'
|
alpha
|
float
|
Transparency level, between 0 and 1. |
1.0
|
reverse
|
bool
|
Whether to reverse the color order. |
False
|
**kwargs
|
Any
|
Additional keyword arguments forwarded to plotnine.scale_fill_gradientn. |
{}
|