prevent plot from showing in jupyter notebook

后端 未结 6 2192
梦毁少年i
梦毁少年i 2020-12-04 23:19

How can I prevent a specific plot to be shown in Jupyter notebook? I have several plots in a notebook but I want a subset of them to be saved to a file and not shown on the

6条回答
  •  执念已碎
    2020-12-05 00:08

    Perhaps just clear the axis, for example:

    fig= plt.figure()
    plt.plot(range(10))
    fig.savefig("save_file_name.pdf")
    plt.close()
    

    will not plot the output in inline mode. I can't work out if is really clearing the data though.

提交回复
热议问题