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.

36 lines
1.3 KiB

# CPI matplotlib plotting style
4 years ago
This library provides a custom plotting style for [matplotlib][mpl] and
other libraries building on matplotlib like [pandas][pd] or [seaborn][sns].
The plotting style is set to aproximately the styles described in
[our wiki], more precicely in this [PowerPoint presentation][ppt].
## how to use it
copy the file `cpi.mplstyle` into the directory with your analysis and tell
matplotlib to use this style:
usage with matplotlib / pyplot:
> from matplotlib import pyplot
> pyplot.style.use('./cpi.mplstyle')
usage with other libraries based on matplotlib, 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.
to use the seaborn.set_palette() function to change line colors seems
to be fine
to use this style as your default matplotlib style, have a look at
https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files
[mpl]: https://matplotlib.org/
[pd]: https://pandas.pydata.org/
[sns]: https://seaborn.pydata.org/
[wiki]: https://wiki.cpi.imtek.uni-freiburg.de/ScientificWriting
[ppt]: https://wiki.cpi.imtek.uni-freiburg.de/ScientificWriting?action=AttachFile&do=view&target=140109-scientific-writing-06-figures-and-figure-captions.pptx