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