Skip to content

TW3

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_tw3(palette='blue', n=11, alpha=1.0, reverse=False)

Tailwind CSS 3 color palette (continuous/sequential).

Parameters:

Name Type Description Default
palette str

Palette name: "slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", or "rose".

'blue'
n int

Number of colors to generate.

11
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_tw3 = scale_color_tw3 module-attribute

scale_color_tw3(palette='blue', *, alpha=1.0, reverse=False, **kwargs)

Tailwind CSS 3 color scale (continuous/sequential).

Parameters:

Name Type Description Default
palette str

Palette name: "slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", or "rose".

'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_tw3(palette='blue', *, alpha=1.0, reverse=False, **kwargs)

Tailwind CSS 3 fill scale (continuous/sequential).

Parameters:

Name Type Description Default
palette str

Palette name: "slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", or "rose".

'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.

{}