Skip to content

Material

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_material(palette='red', n=10, alpha=1.0, reverse=False)

Material Design color palette (continuous/sequential).

Parameters:

Name Type Description Default
palette str

Palette name: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", or "blue-grey".

'red'
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_material = scale_color_material module-attribute

scale_color_material(palette='red', *, alpha=1.0, reverse=False, **kwargs)

Material Design color scale (continuous/sequential).

Parameters:

Name Type Description Default
palette str

Palette name: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", or "blue-grey".

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

Material Design fill scale (continuous/sequential).

Parameters:

Name Type Description Default
palette str

Palette name: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", or "blue-grey".

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

{}