title: embedding matplotlib figure and change its size
body: <p>I had the same problem like <a href="https://stackoverflow.com/questions/10737459/embedding-a-matplotlib-figure-inside-a-wxpython-panel">here</a>.<br>
  It works, but this figure shall not cover the whole frame; so I changed size and position of his panel. Problem now is, that my figure still has the same size of my frame and therefore I only changed the panelsize, my figure gets "cut". How can I solve this?<br>
  Example for better understanding: My Frame is 800x600 and my figure shall only have the size 400x300 inside this frame.</p>
  
  <p>edit:</p>
  
  <pre><code>import wx
  from numpy import arange, sin, pi
  import matplotlib
  #matplotlib.use('WXAgg')
  
  from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
  from matplotlib.backends.backend_wx import NavigationToolbar2Wx
  from matplotlib.figure import Figure
  
  class MainFrame(wx.Frame):
      def __init__(self):
          wx.Frame.__init__(self, None, wx.ID_ANY, 
                            "Pyramid App",size=(800,600),pos=((wx.DisplaySize()[0]-800)/2,(wx.DisplaySize()[1]-600)/2),style= wx.SYSTEM_MENU | wx.CAPTION | wx.MINIMIZE_BOX | wx.CLOSE_BOX)
  
          self.PageThree = pageThree(self)
  
  class pageThree(wx.Panel):
      def __init__(self, parent):
          wx.Panel.__init__(self, parent=parent,size=(800,525))
          self.myparent=parent
          self.pageThree=wx.Panel(self,size=(800,525)) # put some elements at this panel
          self.pylabfigure = wx.Panel(self,size=(440,420),pos=(350,105)) # this is the panel for my figure
          self.drawPylabFigure()
          self.draw()
  
      def drawPylabFigure(self):
          self.figure = Figure()
          self.axes = self.figure.add_subplot(111)
          self.canvas = FigureCanvas(self.pylabfigure, -1, self.figure)
          self.sizer = wx.BoxSizer(wx.VERTICAL)
          self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
          self.SetSizer(self.sizer)
          self.Fit()
  
      def draw(self):
          #example drawing
          t = arange(0.0, 3.0, 0.01)
          s = sin(2 * pi * t)
          self.axes.plot(t, s)
  
  if __name__ == "__main__":
      app = wx.App()
      MainFrame().Show()
      app.MainLoop()
  </code></pre>