title: How to make a FigureCanvas fit a Panel?
body: <p>I'm trying to display some data using Matplotlib and wxPython. I've got a Figure that's added to a FigureCanvasWxAgg. The canvas is then added to a BoxSizer and set to wx.EXPAND|wx.ALL, the BoxSizer on its turn is set by SetSizerAndFit.</p>
  
  <pre><code>self.figure = Figure(None, dpi = 75)
  self.displaycanvas = FigureCanvas(self, -1, self.figure)
  self.axes = self.figure.add_subplot(111)
  self.axes.imshow(self.data, interpolation="quadric")     
  
  self.mainSizer = wx.BoxSizer()
  self.mainSizer.Add(self.displaycanvas, 1, wx.EXPAND|wx.ALL, 5)
  self.SetSizerAndFit(self.mainSizer)
  </code></pre>
  
  <p>This panel is then added to another panel, where its size get's determined relative to other panels that are being added. While I'm happy with the outer size of the panel, I can't get the figure to fit the panel:</p>
  
  <p><img src="https://i.stack.imgur.com/yv419.png" alt="enter image description here"></p>
  
  <p>The large panel with all the paws should be scaled to fit the panel, while maintaining its aspect ratio. </p>
  
  <p>So I'm wondering, <strong>why won't the figure expand to fit the panel?</strong></p>