ui.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:autoxd 作者: nessessary 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号