Skip to main content

charite-plot

PyPI Version PyPI License PyPI Python Version PyPI Types GitHub Actions Workflow Status Website

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 enable

enable()

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 using

with using(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(**kwargs) Returns a matplotlib rcParams dict for the Charité theme
mpl_themes.enable(**kwargs) Applies the theme permanently to rcParams
mpl_themes.using(**kwargs) Context manager: applies the theme temporarily
altair_themes.theme_charite(**kwargs) Returns a Vega-Lite config dict for the Charité theme
altair_themes.enable(**kwargs) Registers and enables the theme in Altair
altair_themes.using(**kwargs) Context manager: enables the theme temporarily
altair_themes.register() Registers the theme without enabling it (Altair-only)
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:

enable(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.3.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.

Metadata

Release files for charite-plot 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for charite-plot 0.3.0
File Size Uploaded
charite_plot-0.3.0.tar.gz 248.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for charite-plot 0.3.0
File Interpreter ABI Platform
charite_plot-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 262.9 kB

Release files / charite_plot-0.3.0.tar.gz

Download URL charite_plot-0.3.0.tar.gz
Size 248.5 kB
Tags Source
SHA-256 checksum
How to use checksums
194ae6dcce911f03a04db27a21b5cec2598883dba3fa957c405e074f8dea26ea
BLAKE2b-256 checksum
How to use checksums
846c26b023bbd01d01c8a95b4ccd1a49057f630a143808cf23856d762e18a471
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / charite_plot-0.3.0-py3-none-any.whl

Download URL charite_plot-0.3.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c5f785cf07e2a7129db2bab52ddbc3777b8286cf58b652b641d38e0efe90800
BLAKE2b-256 checksum
How to use checksums
cbf37f3c49463570c9ecdac01c64a57dd19770b73e37565eb2a7601127db31a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page