Skip to main content

charite-plot

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

A Python package with Matplotlib and Altair themes and visual identity colour palettes for Charité – Universitätsmedizin Berlin and the Berlin Institute of Health at Charité (BIH) — 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() or theme_bih() to match the Charité or BIH corporate style.

CharitéBIH

Heatmaps use the brand's sequential colormap by default; make_cmap("diverging") gives the diverging one.

CharitéBIH

Preview the available colour palettes of each brand.

CharitéBIH

Continuous colormaps (make_cmap): each brand's sequential and diverging scale, every palette, and white → colour.

CharitéBIH

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)

BIH

Every function takes a keyword-only brand argument (default "charite"):

from charite_plot import mpl_themes, altair_themes

mpl_themes.enable(brand="bih")
altair_themes.enable(brand="bih", palette="versus")
params = mpl_themes.theme_bih(font_size=8)  # = mpl_themes.theme(font_size=8, brand="bih")

The BIH theme follows the BIH brand handbook (colours, Trebuchet MS, tints in 10 % steps) with one deliberate deviation: text and axes are black instead of BIH-Blau, as expected by scientific journals. Titles stay BIH-Blau.

Continuous colormaps

from charite_plot import make_cmap, make_ramp

ax.imshow(data, cmap=make_cmap("prime_blue"))  # white → Charité blue, like "Blues"
ax.scatter(x, y, c=z, cmap=make_cmap("goldelse"))  # through a whole palette
alt.Scale(range=make_ramp("blau", brand="bih"), interpolate="rgb")  # same gradient in Altair

API overview

Symbol Description
mpl_themes.theme(**kwargs, brand="charite") Returns a matplotlib rcParams dict for a brand theme (theme_charite / theme_bih = theme with brand="charite" / "bih")
mpl_themes.enable(**kwargs) Applies the theme permanently to rcParams
mpl_themes.using(**kwargs) Context manager: applies the theme temporarily
altair_themes.theme(**kwargs, brand="charite") Returns a Vega-Lite config dict for a brand theme (theme_charite / theme_bih = theme with brand="charite" / "bih")
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 the 10 named Charité colour palettes (BIH: BIH.palettes)
make_palette(name, n, reverse, brand) Subsample or interpolate any palette
make_cmap(name, reverse, brand) Continuous matplotlib colormap through a palette, or white → one brand colour (like "Blues")
make_ramp(name, reverse, brand) The colour stops of that scale, e.g. for alt.Scale(range=make_ramp(...), interpolate="rgb")
CHARITE, BIH The built-in brands (colours, palettes, fonts, colour roles)
Brand, Roles, register_brand(), get_brand(), tint() Define and register further brands (see charite_plot/brands/)
CHARITE_COLORS Dict of all 27 hex colour constants

Fonts

The Charité fallback chain follows the official Charité brand guidelines:

Charité Text Office → Charit? Text Office → Calibri → DejaVu Sans → sans-serif

For BIH, the brand handbook prescribes Trebuchet MS:

Trebuchet MS → 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.4.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.4.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.4.0
File Size Uploaded Provenance Actions
charite_plot-0.4.0.tar.gz 953.9 kB Without provenance Details for charite_plot-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 976.5 kB

Release files / charite_plot-0.4.0.tar.gz

Download URL charite_plot-0.4.0.tar.gz
Size 953.9 kB
Tags Source
SHA-256 checksum
How to use checksums
008b71bb795d66937d36bd701c7bd756691ff4660827b42c8975953f1c7bf9c1
BLAKE2b-256 checksum
How to use checksums
7e86251ce80682867882758094f10ce9783fed23b709b6b529716092e70a07be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL charite_plot-0.4.0-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
344ba93445394f02fd2105595af581586ff5f07097d58d523d21f7f042768373
BLAKE2b-256 checksum
How to use checksums
9beb86309e95bd09e99e6a862ad6c85ae30d368c85c43e091f94f620c568cf50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for charite-plot 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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