You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If text.usetex is enabled, then setting tick labels using Axes.set_xticklabels causes the font to be changed (as if text.usetex were disabled) for that axis.
import numpy as np
from matplotlib import pyplot as pt, rcParams
rcParams['text.usetex'] = True
x = np.linspace(0,10,101)
y = np.sin(x)
fig = pt.figure(figsize=(3.375, 2.5))
ax = fig.add_axes([.15,.15,.8,.8])
pt.plot(x, y)
pt.xlabel(r'$\alpha$')
pt.savefig('mpl_font_testA.png')
ax.set_xticklabels(np.arange(0,11,2))
pt.savefig('mpl_font_testB.png')
Example output is below.
Before calling ax.set_xticklabels:
After calling ax.set_xticklabels:
The text was updated successfully, but these errors were encountered:
If
text.usetex
is enabled, then setting tick labels usingAxes.set_xticklabels
causes the font to be changed (as iftext.usetex
were disabled) for that axis.Example output is below.
Before calling
ax.set_xticklabels
:After calling
ax.set_xticklabels
:The text was updated successfully, but these errors were encountered: