code: def OnInit(self):
      xrcfile = cbook.get_sample_data(
          "embedding_in_wx3.xrc", asfileobj=False
      )
      print("loading", xrcfile)
  
      self.res = xrc.XmlResource(xrcfile)
  
      # main frame and panel ---------
  
      self.frame = self.res.LoadFrame(None, "MainFrame")
      self.panel = xrc.XRCCTRL(self.frame, "MainPanel")
  
      # matplotlib panel -------------
  
      # container for matplotlib panel (I like to make a container
      # panel for our panel so I know where it'll go when in XRCed.)
      plot_container = xrc.XRCCTRL(self.frame, "plot_container_panel")
      sizer = wx.BoxSizer(wx.VERTICAL)
  
      # matplotlib panel itself
      self.plotpanel = PlotPanel(plot_container)
      self.plotpanel.init_plot_data()
  
      # wx boilerplate
      sizer.Add(self.plotpanel, 1, wx.EXPAND)
      plot_container.SetSizer(sizer)
  
      # whiz button ------------------
      whiz_button = xrc.XRCCTRL(self.frame, "whiz_button")
      whiz_button.Bind(wx.EVT_BUTTON, self.plotpanel.OnWhiz)
  
      # bang button ------------------
      bang_button = xrc.XRCCTRL(self.frame, "bang_button")
      bang_button.Bind(wx.EVT_BUTTON, self.OnBang)
  
      # final setup ------------------
      self.frame.Show()
  
      self.SetTopWindow(self.frame)
  
      return True
  
file_path: matplotlib/galleries/examples/user_interfaces/embedding_in_wx3_sgskip.py
imports: import wx
  import wx.xrc
  import numpy
  from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
  from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
  import matplotlib.cbook
  import matplotlib.cm
  from matplotlib.figure import Figure
label_desc: Use image node_id 1 for calling the MyApp obj's underlying member method code with example usage: obj.OnInit() and returns: True