Provides a custom plotting style for matplotlib and other libraries building on it like pandas or seaborn. The plotting style is set to aproximately the styles described in our wiki: https://wiki.cpi.imtek.uni-freiburg.de/ScientificWriting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Holger Frey 5e3972ee70 updated readme 4 years ago
.gitignore Initial commit 4 years ago
LICENSE Initial commit 4 years ago
README.md updated readme 4 years ago
compile.py first working version 4 years ago
cpi.mplstyle first working version 4 years ago
custom cpi styles.txt first working version 4 years ago
default.mplstyle first working version 4 years ago
example.ipynb added example notebook 4 years ago
example_after.png added examples to readme 4 years ago
example_before.png added examples to readme 4 years ago
test_data.pkl first working version 4 years ago

README.md

CPI matplotlib plotting style

This library provides a custom plotting style for matplotlib and other libraries building on matplotlib like pandas or seaborn.

The plotting style is set to aproximately the styles described in our wiki, more precicely in this PowerPoint presentation.

Before:

Default matplotlib style

After:

CPI matplotlib style

how to use it

Copy the file cpi.mplstyle into the directory with your analysis and tell matplotlib to use this style:

from matplotlib import pyplot
pyplot.style.use('./cpi.mplstyle')

For usage with other graphing libraries like searborn:

from matplotlib import pyplot
import seaborn
pyplot.style.use('./cpi.mplstyle')

Be aware that the set* functions of seaborn (like set_theme) might mess with the matplotlib style. The seaborn.set_palette() function to change line colors seems to be woring fine

set as default style

To use this style as your default matplotlib style, have a look at the matplotlib documentation

how to make changes

Please add changes only to the file custom cpi style.txt. After modifying the file use python3 compile.py to generate a file with custom styles.

the examples

If you are curios on how the examples were created, have a look at the Jupyter Notebook example.ipynb.