小编AQE*_*TAF的帖子

在colaboratory上使用plt.savefig保存数据

我正在使用协作(在线jupyter笔记本),我有以下代码,我正在使用此功能绘制一些图形,并想在本地保存图形,我该怎么做?

def make_plot_comparison(Xlabel,Ylabel,l1,l2,l1_title,l2_title,name): 
    plt.xlabel(Xlabel)
    plt.ylabel(Ylabel)
    plt.plot(l1,label=l1_title)
    plt.plot(l2,label=l2_title)
    plt.legend(loc='center right')
    plt.title(name)
    #plt.xlim(-5, 25)
    plt.savefig("abc.png")
    plt.show()
Run Code Online (Sandbox Code Playgroud)

python matplotlib jupyter-notebook

4
推荐指数
2
解决办法
5846
查看次数

标签 统计

jupyter-notebook ×1

matplotlib ×1

python ×1