This repository contains RWTH Aachen University's corporate design color definitions in different formats. See here for oringinal color defintions (German only)
An XML file containing most RWTH colors
A .gpl file for Inkscape. Place in the palette folder of your Inkscape installation. You can find the location in the Inkscape settings under System.
.css file containing all RWTH Colors
.tex file containing all RWTH Colors for use with the xcolor package
A json file containing all RWTH Colors for use with draw.io
The rwthcolors package allows you to integrate RWTH's official color palette into your Python applications, particularly for use with matplotlib.
Install rwthcolors via pip:
pip install rwthcolorsTo automatically set the default color cycle to RWTH colors, simply import:
import RWTHColorsThis will make all matplotlib figures by default use RWTH colors!
Alternatively, apply RWTH colors to your matplotlib plots using:
plt.style.use('rwth')Additional styles include:
rwth-full: A color cycle with more colors.rwth-dark: For dark backgrounds. Use it with:with plt.style.context(['dark_background', 'rwth-dark']): # Your plotting code here
To access colors explicitly, use ColorManager:
from RWTHColors import ColorManager
cm = ColorManager()Example to get RWTH black at 75% intensity:
c = cm.RWTHSchwarz.p(75)By default, this returns the HEX code. For RGB codes, instantiate ColorManager with:
cm = ColorManager(frmt='RGB')Retrieve colors directly by calling them:
c = cm.RWTHBlau() # RWTHBlau at 100%
c = cm.RWTHBlau(50) # RWTHBlau at 50%Print color values using:
print(RWTHRot.colors('RGB')) # or
print(RWTHRot())When instantiated, ColorManager replaces matplotlib's default color cycle with the cycle used in the rwth mplstyle.
Display all RWTH colors with:
cm.plot_color_palette()Enhance your plots by combining rwthcolors with the SciencePlots package. Example style combination:
with plt.style.context(['science', 'grid', 'rwth']):
# Your plotting code hereimport matplotlib.pyplot as plt
import numpy as np
import RWTHColors
import scienceplots
plt.style.use(['science', 'grid', 'rwth'])
x = np.arange(0, 4*np.pi, .01)
fig, ax = plt.subplots(1, 1, figsize=(10, 4))
for a in [1, 2, 3, 4, 5, 6, 7, 8]:
ax.plot(x, a*np.sin(x), label='$\hat{a}=$' + '${}$'.format(a))
ax.legend(loc=1)
ax.set_xlabel('$x$')
ax.set_ylabel('$f(x)$')
plt.show()This produces:
RWTHColors also provides themes for the plotting library Vega-Altair. To activate the themes inlclude the following before using altair:
import altair as alt
import RWTHColors
alt.theme.enable("rwth") # or "rwth-full" or "rwth-dark"The themes rwth, rwth-full and rwth-dark, analog to the matplotlib themes are available. Then you can craete plots as usual, e.g.,:
import altair as alt
import pandas as pd
import RWTHColors
alt.theme.enable("rwth") # or "rwth-full" or "rwth-dark"
source = pd.DataFrame(
{
"a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"],
"b": [28, 55, 43, 91, 81, 53, 19, 87, 52],
}
)
bar = alt.Chart(source).mark_bar(tooltip=True).encode(x="a:N", y="b:Q").properties(title='Bar Chart')In the examples folder you can find examples using RWTHColors.
This requires additional dependencies that can be installed via
pip install rwthcolors[examples]This repository is not maintained by RWTH Aachen University's marketing department but a voluntary offer by the Institute of Rail Vehicles. If you have the color definitions in other formats, feel free to contribute them using a merge request.

