code: def on_press(event):
      print("press", event.key)
      sys.stdout.flush()
      if event.key == "x":
          visible = xl.get_visible()
          xl.set_visible(not visible)
          fig.canvas.draw()
  
imports: import sys
  import matplotlib.pyplot
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: on_press(event) without return types