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

plt.close() will close the figure window entirely, where plt.clf() will just clear the figure – you can still paint another plot onto it.

It sounds like, for your needs, you should be preferring plt.clf(), or better yet keep a handle on the line objects themselves (they are returned in lists by plot calls) and use .set_data on those in subsequent iterations.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)