Difference between plt.close() and plt.clf()

前端 未结 4 1650
猫巷女王i
猫巷女王i 2020-12-29 03:49

In Python, what is the difference between plt.clf() and plt.close()?

Will they function the same way?

4条回答
  •  梦毁少年i
    2020-12-29 04:32

    plt.clf() clears the entire current figure with all its axes, but leaves the window opened, such that it may be reused for other plots.

    plt.close() closes a window, which will be the current window, if not specified otherwise.

提交回复
热议问题