Skip to main content

Adding standard themes with RWTH Aachen University colours to matplotlib

Project description

rwthplots

Matplotlib style sheets, colormaps, and figure utilities for RWTH Aachen University's corporate design palette.

PyPI Python CI Docs License

Developed at the Institute for High Voltage Equipment and Grids, Digitalization and Energy Economics (IAEW), RWTH Aachen University.


What it does

rwthplots brings the official RWTH Aachen corporate design into Matplotlib — so your thesis, paper, and presentation figures are always on-brand without manual rcParams setup.

  • Style sheets for every output format: LaTeX/thesis, Word, PowerPoint, Beamer, dark-mode
  • 38 colormaps (+ _r reversed variants) — discrete, diverging, sequential, and power-system maps
  • Journal presets for IEEE, Nature, Elsevier, Springer, APS, and ACM
  • Accessibility utilities — CVD simulation, colour-confusion detection, greedy pick_colors()
  • Figure sizingset_size() with 15 paper/journal presets and golden-ratio height
  • Multi-format exportsave_figure() writes PDF + PNG + SVG in one call

Gallery

RWTH colour palette — 13 base colours × 5 tint levels

Colour palette

Line plot with context() and pick_colors(6)

Style demo

Colormaps — selection of available maps

Colormaps

Climate stripes — Nordrhein-Westfalen 1881–2025, DWD area average

Climate stripes


Installation

pip install rwthplots

Or install the latest development version directly from GitHub:

pip install git+https://github.com/RWTH-IAEW/rwthplots.git

Requires Python ≥ 3.10 and Matplotlib ≥ 3.7.


Quick start

import rwthplots
import matplotlib.pyplot as plt

# Apply a style — all styles and colormaps are registered on import
with rwthplots.context("rwth-latex", "color.blue", "size.ieee-column"):
    fig, ax = plt.subplots()
    ax.plot(x, y)
    rwthplots.save_figure(fig, "results/fig1", formats=["pdf", "png"])

See the Quick Start guide for a full walkthrough.


Style sheets

Base styles

Name Use case
rwthplots.styles.rwth-latex LaTeX/PGF, thesis, journal
rwthplots.styles.rwth-word Word, reports
rwthplots.styles.rwth-pptx PowerPoint
rwthplots.styles.rwth-latex-pptx LaTeX-rendered text in PPT
rwthplots.styles.rwth-latex-beamer Beamer slides
rwthplots.styles.rwth-dark Dark background / screens

Modifier layers

Stack any modifier on top of a base style:

Category Examples
color/ color.blue, color.orange, color.green, … (16 total)
misc/ misc.grid, misc.colorblind, misc.sans, misc.no-latex, …
journals/ journals.ieee, journals.nature, journals.elsevier, journals.springer, journals.aps, journals.acm
size/ size.ieee-column, size.a4, size.nature-column, … (15 total)

Colormaps

38 colormaps registered on import (plus _r reversed variants for all). Key maps:

Name Type Description
extended_RWTH_discrete discrete Full RWTH palette, up to 65 colours (lut=)
continuous_RWTH_discrete discrete Continuous coverage, 1–65 colours (lut=)
divergent_RWTH diverging Blue → green → red
divergent_bm_RWTH diverging Blue – white – magenta
divergent_gy_RWTH diverging Green – white – yellow
viridis_RWTH sequential Violet → turquoise → may green → yellow
thermal_RWTH sequential Black → bordeaux → red → orange → yellow → white (blackbody)
loading_RWTH sequential Blue → white → yellow → red → bordeaux (line/transformer loading)
voltage_RWTH diverging Red → orange → green → orange → red (voltage deviation)
blue_RWTH sequential Blue tint gradient
(+ 12 single-colour gradients) One per RWTH base colour

Development

git clone https://github.com/RWTH-IAEW/rwthplots.git
cd rwthplots
uv sync --group dev
uv run python -m pytest -q

License

MIT — see LICENSE.txt.

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

rwthplots-3.2.1.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

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

rwthplots-3.2.1-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

Details for the file rwthplots-3.2.1.tar.gz.

File metadata

  • Download URL: rwthplots-3.2.1.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rwthplots-3.2.1.tar.gz
Algorithm Hash digest
SHA256 afa1de26830e91eca4c89b8e0b06b7f17e80df36edd06905cedbf2a9dcd9e485
MD5 61a8c1dbb97a44e50accb8e16a02c3db
BLAKE2b-256 335174be8960378ddadb805ca498d77d75dd1266287155b438f7543b343a3728

See more details on using hashes here.

Provenance

The following attestation bundles were made for rwthplots-3.2.1.tar.gz:

Publisher: release.yml on RWTH-IAEW/rwthplots

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rwthplots-3.2.1-py3-none-any.whl.

File metadata

  • Download URL: rwthplots-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 54.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rwthplots-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1e5eb4081684e69be35fa596a5eeb38f328959ff20eed90df55a11e0ae9a70
MD5 ab0b0a05d6bd0c74fc955ff279c1c98d
BLAKE2b-256 ac5612291ad70fe4ff9718c357c2136be6c1674a9bb75f794e0a1b2a75cc998a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rwthplots-3.2.1-py3-none-any.whl:

Publisher: release.yml on RWTH-IAEW/rwthplots

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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