Skip to main content

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 → sans-serif

DejaVu Sans ships with Matplotlib and is always available as the penultimate fallback; sans-serif lets the browser or system choose if nothing else matches (important for Altair/Vega-Lite). To override the preferred font:

apply_theme(theme_charite(font="Arial"))

How to cite

If you use charite-plot in your work, please cite it as:

@software{ramezani2026chariteplot,
  author    = {Ramezani, Pedram},
  title     = {charite-plot: Matplotlib and Altair Themes for Charité – Universitätsmedizin Berlin},
  year      = {2026},
  version   = {0.2.0},
  url       = {https://github.com/pedramezani/charite-plot},
  license   = {MIT},
}

Acknowledgements

This package is based on the original charite R package developed by Johannes Julius Mohn.

License

MIT © 2026 Pedram Ramezani

The original charite R package by Johannes Julius Mohn is likewise MIT licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charite_plot-0.2.0.tar.gz (247.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charite_plot-0.2.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file charite_plot-0.2.0.tar.gz.

File metadata

  • Download URL: charite_plot-0.2.0.tar.gz
  • Upload date:
  • Size: 247.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for charite_plot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 23369eb576292f8a66c60b6aa4ec9d627919b5234a2c7c6b95e4e51126a5c831
MD5 080727dff61f8adb18575cc2842da1ed
BLAKE2b-256 39460605810207495702028e6400c09efedfcb259ae00a4d030de0c10d612f8d

See more details on using hashes here.

File details

Details for the file charite_plot-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: charite_plot-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for charite_plot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cfe784195af71f78866ef74c4a894f24f3cb51144cd03f6ad1adc71166210ac
MD5 675ff233e35ce3ecfccec04ec52fe3e4
BLAKE2b-256 4f22b9dd56171798a0ddd46c8cf41a361e50123d6a86b562fcddba3f05562222

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page