我找不到有这个问题的人.在matplotlib中,您可以使用show()或savefig()查看绘图.这些产生略微不同的图像;在我的情况下,savefig()图像更难以理解.我需要让我的考试生活轻松,所以……
我找到了一些建议我设置DPI大小以匹配show()的主题.我试过了:
– >使用matplotlib.rcParams [‘savefig.dpi’] = 80直接设置savefig.dpi.
– >直接在〜/ .matplotlib / matplotlibrc中设置savefig.dpi.
– >将我的rc文件移动到CWD.
– >最后,使用savefig(‘image.pdf’,dpi = 80)
我可以验证该属性确实已设置;但看起来设置是由savefig()igored.有人能帮忙吗?
(简体)代码:
plt.bar(ind, functimes, yerr=stddev, bottom=0, width=barWidth, align='center', color='b')
ax = plt.gca()
ax.legend(barRcts, barLegend)
plt.title("Function Call Overhead")
plt.xlabel("Function ID")
plt.ylabel("Execution Time [us]")
plt.xticks(ind, funcNames)
figtest.autofmt_xdate()
plt.savefig(out_file, dpi=80, format='pdf')