def DrawTs(pl, ts=[], lines = None, title="", high=[], low=[],mid=[], save_file=False,legends=None):
"""?????, ts: closes, save_file: ?????????"""
pl.figure
legend = []
if len(ts)>0:
pl.plot(ts)
legend.append('ts')
if len(high)>0:
pl.plot(high)
legend.append('high')
if len(low)>0:
pl.plot(low)
legend.append('low')
if len(mid)>0:
pl.plot(mid)
legend.append('mid')
prop = fm.FontProperties(fname="c:/windows/fonts/simsun.ttc")
if title != "":
pl.title(title, fontproperties=prop)
if lines != None:
i = lines
if i>=len(ts):
i = len(ts)-1
pl.plot([i,i], [ts[i]-ts[i]*0.1, ts[i]+ts[i]*0.1], 'g')
legend.append('lines')
if legends is not None:
legend = legends
pl.legend(legend, loc='upper left')
if save_file:
fname = 't3.png'
pl.savefig(fname)
return fname
pl.show()
pl.close()
评论列表
文章目录