human
Here does this for us given the following:
I am working on the file "Lecture-widgets.ipynb".
The first task is:
Let's see how this works.
python
self.figure = Figure()
initializes the top level container for all plot elements. Everything in the
plot goes within this object, just like everything in our wx application goes into
our frame!
python
self.axes = self.figure.add_subplot(111)
Our figure can contain many subplots, but here we will only make
one. add_subplot() is what does this for us. The 111 is a grid
parameter, encoded as an integer. It means 1x1 grid, first subplot. If
you want two subplots, the number would be 2x1.
the first subplot
would be 211, and the second subplot would be 212.
python
self.axes.plot(t, s)
t and s are what I chose for axis values.
They are arrays that contain values that link with each other to form our plot. These arrays
must have the same size! 
This command creates and plots the t and s arrays. Since self.axes was defined as a
subplot of self.figure, this also plays a role in generating
self.figure, the container of our subplot. 
python
self.canvas = FigureCanvas(self, -1, self.figure)
Finally, we have our canvas object, which paints our object onto the
screen. Simply pass in our figure and the FigureCanvas tool does the
rest. 
Navigation toolbar
A useful toolbar is the navigation toolbar defined in matplotlib which allows one to explore the image.
Let's add to our previous example this toolbar.
Can you write Python code for it?
assistant
#Here does this for us.

%%writefile mpl_demo.py
#!/usr/bin/env python
import wxversion
wxversion.ensureMinimal('2.8')

from numpy import arange, sin, pi
from matplotlib.backends.backend_wxagg import \
    FigureCanvasWxAgg as FigureCanvas, \
    NavigationToolbar2WxAgg as NavigationToolbar
from matplotlib.figure import Figure
import wx

class CanvasFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1,
                          'CanvasFrame', size=(550, 350))

        self.figure = Figure()
        self.axes = self.figure.add_subplot(111)
        t = arange(0.0, 3.0, 0.01)
        s = sin(2 * pi * t)

        self.axes.plot(t, s)
        self.canvas = FigureCanvas(self, -1, self.figure)

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.EXPAND)
        self.SetSizer(self.sizer)
        self.Fit()
        self.add_toolbar()  #add toolbar

    def add_toolbar(self):
        self.toolbar = NavigationToolbar(self.canvas)
        self.toolbar.Realize()
        # By adding toolbar in sizer, we are able to put it at the bottom
        # of the frame - so appearance is closer to GTK version.
        self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
        # update the axes menu on the toolbar
        self.toolbar.update()

class App(wx.App):
    def OnInit(self):
        'Create the main window and insert the custom frame'
        frame = CanvasFrame()
        frame.Show(True)
        return True

app = App(0)
app.MainLoop()        

!python mpl_demo.py