code: def on_activate(app):
      win = Gtk.ApplicationWindow(application=app)
      win.set_default_size(400, 300)
      win.set_title("Embedding in GTK4")
  
      fig = Figure(figsize=(5, 4), dpi=100)
      ax = fig.add_subplot()
      t = np.arange(0.0, 3.0, 0.01)
      s = np.sin(2 * np.pi * t)
      ax.plot(t, s)
  
      # A scrolled margin goes outside the scrollbars and viewport.
      sw = Gtk.ScrolledWindow(
          margin_top=10,
          margin_bottom=10,
          margin_start=10,
          margin_end=10,
      )
      win.set_child(sw)
  
      canvas = FigureCanvas(fig)  # a Gtk.DrawingArea
      canvas.set_size_request(800, 600)
      sw.set_child(canvas)
  
      win.show()
  
imports: import gi
  from gi.repository import Gtk
  import numpy
  from matplotlib.backends.backend_gtk4agg import FigureCanvasGTK4Agg
  from matplotlib.figure import Figure
label_desc: Use image node_id 1 for calling a global function with example usage: on_activate(app) without return types