学术论文的图绘制要求:
- 尽量清楚, 字体、曲线、标记尽量大
- 分辨率要求,最低dpi要求,例如dpi最低300
- 保存格式,例如pdf
- 无颜色印刷,需要标记来区分类别
一个绘图示例
font_size = 13
label_size = 11.5
lw = 2
font = fm.FontProperties(size=font_size)
for results in complet_results:
if results['mode'] == 'method1':
label = 'method1'
marker = 'o'
elif results['mode'] == 'method2':
label = 'method2'
marker = '+'
elif results['mode'] == 'method3':
label = 'method3'
marker = '*'
plt.plot(results['test_acc_global'], label=label, marker=marker, linewidth=lw)
plt.xlabel('Rounds', fontproperties=font)
plt.ylabel('Test Acc', fontproperties=font)
plt.grid()
plt.xlim(0, 100)
plt.ylim(0.75, 0.91)
plt.legend(shadow=False, fontsize=font_size, loc=4)
plt.tick_params(labelsize=label_size)
save_path = os.path.join(save_dir, '{}_test_acc_detail'.format(data_name.replace(',', '_')))
plt.savefig(save_path+'.jpg' , dpi=300, bbox_inches='tight')
plt.savefig(save_path+'.pdf', bbox_inches='tight')
plt.show()
plt.close()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)