Matplotlib and Altair themes for Charité – Universitätsmedizin Berlin
Project description
charite-plot
A Python package with a Charité-styled Matplotlib theme, visual identity colour palettes, and an Altair theme — ported from the charite R package.
Installation
pip install charite-plot # Matplotlib only
pip install "charite-plot[altair]" # with Altair support
Examples
Visualize your data with theme_charite() to match the Charité corporate style.
Preview the available colour palettes.
Quick start
Matplotlib
import matplotlib.pyplot as plt
from charite_plot.mpl_themes import theme_charite, apply_theme
apply_theme(theme_charite())
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 7, 3])
ax.set_title("My chart")
plt.show()
Use as a context manager to scope the theme to a single figure:
from charite_plot.mpl_themes import theme_charite, using
with using(theme_charite(palette="goldelse")):
fig, ax = plt.subplots()
ax.bar(["A", "B", "C"], [3, 7, 5])
Altair
from charite_plot.altair_themes import enable
import altair as alt
enable()
chart = alt.Chart(df).mark_bar().encode(...)
Customise with keyword arguments:
enable(palette="berryseason", font_size=13)
API overview
| Symbol | Description |
|---|---|
mpl_themes.theme_charite() |
Returns a matplotlib rcParams dict for the Charité theme |
mpl_themes.apply_theme(params) |
Applies a theme dict permanently to rcParams |
mpl_themes.using(params) |
Context manager: applies theme temporarily |
altair_themes.theme_charite() |
Returns a Vega-Lite config dict for the Charité theme |
altair_themes.enable(**kwargs) |
Registers and enables the theme in Altair |
PALETTES |
Dict of 10 named colour palettes |
make_palette(name, n, reverse) |
Subsample or interpolate any palette |
CHARITE_COLORS |
Dict of all 27 hex colour constants |
Fonts
The fallback chain follows the official Charité brand guidelines:
Charité Text Office → Charit? Text Office → Calibri → DejaVu Sans
Ersatzschrift „Calibri" — Falls die Hausschrift aus technischen Gründen nicht verwendet werden kann, ersetzt die Systemschriftart „Calibri" die Hausschrift. Dies ist beispielsweise bei der E-Mail-Korrespondenz der Fall.
DejaVu Sans ships with Matplotlib and is always available as the final fallback. To override the preferred font:
apply_theme(theme_charite(font="Arial"))
License
MIT © 2026 Pedram Ramezani
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file charite_plot-0.1.0.tar.gz.
File metadata
- Download URL: charite_plot-0.1.0.tar.gz
- Upload date:
- Size: 236.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db3e74ef2a7357aa0d7da080d5134c935289a7097d1d63b4a761ad90aff661d
|
|
| MD5 |
65c0f62ae45390c923c9f9e7f050feea
|
|
| BLAKE2b-256 |
97666be968b628aea7e8e9f76c3e6d65b1fe2ea7f788bb8d2e9c3e037c9713d3
|
File details
Details for the file charite_plot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: charite_plot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
956bd47fffc9ad16b54e826ea7c0343c4726cc41e11a374e7f2ac18c243943f6
|
|
| MD5 |
edcdf5f89d221c5b16815b6b37704870
|
|
| BLAKE2b-256 |
e271d24b72af1553237cf718b1192897a76cc6f078cc64de9f7fc5e6b2668eb8
|