I am trying to remove the unneeded memory in an app I\'ve made using tkinter. Every time a certain button is pressed, it shows a graph using matplotlib
This is my code