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"))

License

MIT © 2026 Pedram Ramezani

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.1.1.tar.gz (236.8 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.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: charite_plot-0.1.1.tar.gz
  • Upload date:
  • Size: 236.8 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.1.1.tar.gz
Algorithm Hash digest
SHA256 549e13fed5f67061e2909fe7df380a1c04b5eb5d7f795a01a195aa0ea37eb6a2
MD5 c9ce8e598b7d03b96c7a58f1b29de959
BLAKE2b-256 025e516ebc75f6c2c6f1a73d0d37566976097608b6de6b4c6e51dc5ce393f94e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: charite_plot-0.1.1-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

Hashes for charite_plot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9b54321758ebc5b74c1459a878937f533706786b121e94e120a3b97065169ef
MD5 1e003dc1439a9e978700cecc51cfac3f
BLAKE2b-256 366be1e109b909328c7fa4426bf79485ba14b22df94ba4b22f8edc835791ba0e

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