1
我正在製作一個繪圖,我需要的軸標題字體略大於圖例字體。我一直無法做到這一點。我正在使用一個樣式文件,並嘗試過:axes.titlesize,legend.fontsize和font.size(它們都會改變它們)。但是,他們似乎沒有給出所需的行爲。matplotlib 2.0更改軸獨立字體大小和圖例字體大小
如何可以將字體大小設置爲每個獨立地,例如,在下面的代碼:
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()