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
663 stars 25 forks source link

Whitespace around figures when saving #100

Closed pnkraemer closed 2 years ago

pnkraemer commented 2 years ago

To avoid unnecessary whitespace around a figure, we should look into setting "savefig.bbox": "tight", and maybe even play around with "savefig.pad_inches", to automatically crop whitespaces around figures.

This setting could be provided as part of the content in tueplots.figsizes, on the same level as constrained_layout.

While this issue has not been resolved yet: a user should consider saving figures as `plt.savefig(..., bbox="tight")``, which accomplishes the same task.

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html

Tagging @philipphennig here, who brought this to my attention.

Contributions are welcome :)