example.py 文件源码

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

项目:matplotlib_pubplots 作者: yoachim 项目源码 文件源码
def example_plot1():
    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)
    x = np.linspace(1., 8., 30)
    ax.set_title('Title!')
    ax.plot(x, x ** 1.5, color='k', ls='solid', label='line 1')
    ax.plot(x, 20/x, color='0.50', ls='dashed', label='line 2')
    ax.set_xlabel('Time (s)')
    ax.set_ylabel('Temperature (K)')
    ax.legend(loc='upper left')
    fig.tight_layout()
    return [fig], ['example_1']

# Should make an OO example where __init__ sets up data, then methods plot it different ways. Should be able to just pass methods along...
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号