Matching fontsizes#
[ ]:
import matplotlib.pyplot as plt
from tueplots import figsizes, fontsizes
# Increase the resolution of all the plots below
plt.rcParams.update({"figure.dpi": 150})
# "Better" figure size to display the font-changes
plt.rcParams.update(figsizes.icml2022_half())
Fontsizes are dictionaries that can be passed to matplotlib.pyplot.rcParams.update()
.
[2]:
fontsizes.icml2022()
[2]:
{'font.size': 8,
'axes.labelsize': 8,
'legend.fontsize': 6,
'xtick.labelsize': 6,
'ytick.labelsize': 6,
'axes.titlesize': 8}
Compare the default font-sizes to, e.g., the ICML style. (To make differences more obvious, we increase the dpi
value.)
[3]:
fig, ax = plt.subplots()
ax.plot([1.0, 2.0], [3.0, 4.0])
ax.set_title("Title")
ax.set_xlabel("xlabel")
ax.set_ylabel("ylabel")
plt.show()
[4]:
plt.rcParams.update(fontsizes.icml2022())
fig, ax = plt.subplots()
ax.plot([1.0, 2.0], [3.0, 4.0])
ax.set_title("Title")
ax.set_xlabel("xlabel")
ax.set_ylabel("ylabel")
plt.show()
[5]:
plt.rcParams.update(fontsizes.neurips2021())
fig, ax = plt.subplots()
ax.plot([1.0, 2.0], [3.0, 4.0])
ax.set_title("Title")
ax.set_xlabel("xlabel")
ax.set_ylabel("ylabel")
plt.show()
[6]:
plt.rcParams.update(fontsizes.aistats2022())
fig, ax = plt.subplots()
ax.plot([1.0, 2.0], [3.0, 4.0])
ax.set_title("Title")
ax.set_xlabel("xlabel")
ax.set_ylabel("ylabel")
plt.show()
[ ]:
[ ]:
[ ]: