code: def on_exit(*args):
      plt.close()
  
imports: import matplotlib.pyplot
  from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
  from matplotlib.figure import Figure
  from tkinter import *
  from tkinter import filedialog
  import platform
  import math
  import caer
label_desc: Use image node_id 16 for calling a global function with example usage: on_exit() without return types