ts_tool.py 文件源码

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

项目:pyktrader2 作者: harveywwu 项目源码 文件源码
def plot_price_series(df, ts_lab1, ts_lab2):
    #months = mdates.MonthLocator()  # every month
    fig, ax = plt.subplots()
    ax.plot(df.index, df[ts_lab1], label=ts_lab1)
    ax.plot(df.index, df[ts_lab2], label=ts_lab2)
    #ax.xaxis.set_major_locator(months)
    #ax.xaxis.set_major_formatter(mdates.DateFormatter('%b %Y'))
    ax.grid(True)
    fig.autofmt_xdate()
    plt.xlabel('Month/Year')
    plt.ylabel('Price ($)')
    plt.title('%s and %s Daily Prices' % (ts_lab1, ts_lab2))
    plt.legend()
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号