【发布时间】:2014-10-30 00:36:03
【问题描述】:
将 xkcd() 与 matplotpib 一起使用时,没有任何字体以通常的漫画字体显示。有什么变化还是我做错了什么?
x = df['Time']
y = df['Adjustment']
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax1 = fig.add_subplot(1,1,1)
ax1.plot(x,y)
ax1.xaxis.set_visible(False)
ax1.yaxis.set_visible(False)
plt.axvline(x=2.3, color='k', ls='dashed')
plt.axvline(x=6, color='k', ls='dashed')
ax.text(4,4,'Culture Shock', size=16)
plt.title('Test title')
plt.xkcd()
plt.show()
感谢您的帮助。
我应该澄清一下,图表将以 xkcd 样式绘制,而不是任何字体。它打印类似于 Times New Roman 的内容。
【问题讨论】:
标签: python matplotlib ipython