Skip to content

mpl_themes

mpl_themes

Matplotlib theme for Charité – Universitätsmedizin Berlin.

theme_charite(font=None, font_size=10, thickness=0.5, grid=False, palette='primary', interactive=False, tiny_margins=False)

Return matplotlib rcParams dict for the Charité corporate identity theme.

Parameters:

Name Type Description Default
font str | None

Preferred font family. Falls back through Charité Text Office → Charit? Text Office → Calibri → DejaVu Sans → sans-serif if the requested font is not installed.

None
font_size int

Base font size in points. Defaults to 10 for screen; use 8 for print.

10
thickness float

Axis line and tick width. Mirrors the R thickness parameter.

0.5
grid bool

Show major grid lines. Disabled by default.

False
palette str | list[str]

Name of a built-in palette or a list of hex color strings used for the axes.prop_cycle.

'primary'
interactive bool

Enable matplotlib interactive mode (equivalent to plt.ion()). Useful in notebooks or scripts where you want plots to display without blocking.

False
tiny_margins bool

Minimise all margins around the plot panel. Useful for dense layouts or when saving figures with little surrounding whitespace.

False

apply_theme(params)

Apply a theme dict as the active matplotlib rcParams (permanent until reset).

using(params)

Context manager: temporarily apply params then restore previous rcParams.

Examples:

with using(theme_charite(palette="goldelse")):
    fig, ax = plt.subplots()
    ax.plot([1, 2, 3])