
Two (subclasses of) panels, a CanvasSubPanel (which draws a matplotlib figure) and UnderPanel are supposed to coexist in a vertical sizer.
While everything within the panels are rendered well, the panels themselves are drawn badly.
What is the solution?
Partial listing of CanvasSubPanel I believe is relevant:
class CanvasSubPanel(wx.Panel):
#LENGTH, WIDTH = SIZE
#_bitmap = None
__click_callback = None
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.figure = Figure()
self.figure.set_size_inches( (10,5) )
self.figure.set_dpi(80)
#self.figure.tight_layout()
self.picture = self.figure.add_subplot(211)
self.intensity = self.figure.add_subplot(212)
...
self.canvas = FigureCanvas(self, -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()
Please respond if I missed important details.
Like Mike Driscoll calls them, parenting issues.
The troubling panel was inadvertently set as child of a frame (like the other panel), not children of a panel with a sizer.