GithubHelp home page GithubHelp logo

ifs-rwth-aachen / rwth-colors Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 434 KB

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/

License: MIT License

CSS 9.70% TeX 14.72% Python 75.58%
rwth rwth-aachen rwth-aachen-university

rwth-colors's Introduction

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

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

Then 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 furthermore 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 for example:

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

or 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 maintened 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.

rwth-colors's People

Contributors

darkoberd00 avatar philipp-leibner avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

didi-hou

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.