【发布时间】:2017-03-25 09:40:41
【问题描述】:
我正在制作一个图,我需要轴标题字体略大于图例字体。我无法做到这一点。我正在使用样式文件并尝试过: axes.titlesize 、 legend.fontsize 和 font.size (两者都会改变)。但是,它们似乎没有给出期望的行为。
我怎样才能为每个独立设置字体大小,例如在下面的代码中:
import matplotlib.pyplot as plt
import scipy
#plt.style.use("myStyle.mplstyle.py")
fig, ax = plt.subplots()
xs = scipy.linspace(0,1,100)
ys1 = scipy.sin(xs)
ys2 = scipy.cos(xs)
ax.plot(xs, ys1,"-",label="sin")
ax.plot(xs, ys2,"-",label="cos")
ax.set_xlabel("this is the title axis")
ax.set_ylabel("this is the title axis 2")
ax.legend()
plt.show()
【问题讨论】:
标签: python matplotlib