class MyFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None)
self.figure = MyFigurePanel(self)
self.buttons = MyButtonPanel(self)
grid = wx.BoxSizer(wx.VERTICAL)
grid.Add(self.buttons, flag=wx.EXPAND)
grid.Add(self.figure, flag=wx.EXPAND)
self.SetSizer(grid)
self.Fit()
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()
simple application using wxPython and matplotlib freezes