ifs-rwth-aachen / RWTH-Colors

RWTH Aachen University Corporate Design Colors in various colors, including a python package to seemlessly integrate RWTH Colors into matplotlib

Home Page:https://www.rwth-aachen.de/cms/root/Die-RWTH/Einrichtungen/Verwaltung/Stabsstellen/Marketing/~eqbm/Corporate-Design/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RWTH Aachen University - Corporate Design Colors

This repository contains RWTH Aachen University's corporate design color definitions in different formats. See here for oringinal color defintions (German only)

Android Studio

An XML file containing most RWTH colors

CSS

.css file containing all RWTH Colors

LaTeX

.tex file containing all RWTH Colors for use with the xcolor package

Draw.io

A json file containing all RWTH Colors for use with draw.io

Python Package

To integrate RWTH's colors into your python application, you can use the rwthcolors package

Installation

You can install rwthcolors via pip:

pip install rwthcolors

Usage

Simply import RWTHColors via : import RWTHColors

This automatically changes the default color cycle to RWTH colors.

Alternatively, you can use: plt.style.use('rwth') to get RWTH colors in your matplotlib plots. Theres also style available called rwth-full containing a color cyle with more colors. There als a style called rwth-dark that is intended to be used with dark backgrounds. E.g. using with plt.style.context(['dark_background', 'rwth-dark']):.. If you want to access colors explictly you can also use

from RWTHColors import ColorManager

and then instantiate a ColorManager using:

cm = ColorManager()

and then for example: c=cm.RWTHSchwarz.p(75) to get RWTH black as 75 % version. The method by default returns the HEX code of the color. If you need RGB codes, you can instantiate a ColorManager using ColorManager(frmt='RGB').

If instantiated, the ColorManager also replaces matplotlibs default color cycle with the same cycle used in mplstlye rwth.

Color Palette

cm.plot_color_palette() returns a figure showing all RWTH colors

Color Palette

Tip

You can get even more beautiful plots if you use rwthcolors together with the SciencePlots python package. Then you can use the following style combination for example and get beautiful scientific looking plots that utilize RWTH colors:

with plt.style.context(['science', 'grid', 'rwth']): ...

Another example:

import 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()

which produces:

Example Plot

Disclaimer

This repository is not maintained by RWTH Aachen University's marketing department but a voluntary offer by the Institute of Rail Vehicles and Transport Systems. If you have the color definitions in other formats, feel free to contribute them using a merge request.

About

RWTH Aachen University Corporate Design Colors in various colors, including a python package to seemlessly integrate RWTH Colors into matplotlib

https://www.rwth-aachen.de/cms/root/Die-RWTH/Einrichtungen/Verwaltung/Stabsstellen/Marketing/~eqbm/Corporate-Design/

License:MIT License


Languages

Language:Python 75.7%Language:TeX 14.6%Language:CSS 9.6%