Skip to content

Commit

Permalink
close figure after it is saved
Browse files Browse the repository at this point in the history
Without plt.close(), the figure is kept open and wastes memory.
  • Loading branch information
martinvoegele authored Aug 13, 2021
1 parent 60facb5 commit bdb833f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pensa/statesinfo/discrete_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ def get_intersects(gaussians, distribution, Gauss_xvals, write_plots=None,write_
plt.title(write_name)
plt.ioff()
plt.savefig('ssi_plots/'+write_name+".png")
plt.close()

return all_intersects

Expand Down

0 comments on commit bdb833f

Please sign in to comment.