pnkraemer / tueplots

Figure sizes, font sizes, fonts, and more configurations at minimal overhead. Fix your journal papers, conference proceedings, and other scientific publications.
https://tueplots.readthedocs.io
MIT License
656 stars 25 forks source link

Collect "opinionated" modules in a dedicated subpackage #130

Open pnkraemer opened 7 months ago

pnkraemer commented 7 months ago

What

Tueplots centres around the content of figsizes.py, fonts.py, fontsizes.py, and bundles.py.

Other modules, namely axes.py, cycler.py, and markers.py, provide easy access to some plot-style changes that are otherwise a bit more involved to update. For example, axes.lines() changes all linewidths to a consistent base_width via rcParams. This functionality is helpful but somewhat opinionated.

Why

I would like to collect modules with such (potentially) opinionated content in a dedicated subpackage, e.g., tueplots.style.*, to distinguish them from the core content: figure sizes, font sizes, and so on. This would simplify the API a little bit:

How

The current API looks like

import matplotlib.pyplot as plt
from tueplots import bundles, axes

plt.rcParams.update(bundles.icml2022())
plt.rcParams.update(axes.lines(base_width=0.75))

The new API would look like

import matplotlib.pyplot as plt 
from tueplots import bundles
from tueplots.style import axes

plt.rcParams.update(bundles.icml2022())
plt.rcParams.update(axes.lines(base_width=0.75))

To be decided

Everyone's feedback is welcome!