增加保存图片的功能

This commit is contained in:
msincenselee 2017-05-19 11:49:10 +08:00
parent 7792ef4ccf
commit e844307987

View File

@ -2955,7 +2955,12 @@ class BacktestingEngine(object):
""" """
plt.tight_layout() plt.tight_layout()
#plt.xticks(xindex, tradeTimeIndex, rotation=30) # 旋转15 #plt.xticks(xindex, tradeTimeIndex, rotation=30) # 旋转15
fig_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), 'TestLogs',
'Fig_{0}.png'.format(
datetime.now().strftime('%Y%m%d_%H%M'))))
fig = plt.gcf()
fig.savefig(fig_file_name)
plt.show() plt.show()
#---------------------------------------------------------------------- #----------------------------------------------------------------------