Skip to content

altair_themes

altair_themes

Altair / Vega-Lite theme for Charité – Universitätsmedizin Berlin.

Register and enable with::

from charite_plot.altair_themes import enable
enable()                              # default params
enable(palette="goldelse")            # custom palette
enable(font="Arial", font_size=13)    # font override

theme_charite(font=None, font_size=12, thickness=0.5, grid=False, palette='primary', background='white', tiny_margins=False)

Return an Altair theme config dict for the Charité corporate theme.

Parameters:

Name Type Description Default
font str | None

Preferred font. Falls back through Charité Text Office → Charit? Text Office → Calibri → DejaVu Sans → sans-serif.

None
font_size int

Base font size in pixels.

12
thickness float

Axis line and tick width.

0.5
grid bool

Show axis grid lines.

False
palette str | list[str]

Built-in palette name or list of hex colors for the categorical range.

'primary'
background str

Chart background color.

'white'
tiny_margins bool

Minimise all paddings around the chart.

False

enable(**kwargs)

Register and enable the Charité theme in Altair.

Parameters:

Name Type Description Default
**kwargs

Any parameter accepted by theme_charite (font, font_size, thickness, grid, palette, background, tiny_margins).

{}

Examples:

from charite_plot.altair_themes import enable
enable(palette="goldelse", font_size=13)

register()

Register the Charité theme with Altair's theme registry (default params).