From: Matt N. <new...@ca...> - 2005-05-29 03:08:41
|
Christian, I don't recall seeing this behavior of absurdly small figures and no response to figsize argement, even using wxPython 2.5.3 on Mac OS X (though, admittedly I'm using matplotlib 0.8). The script below works fine for me, and changing the figsize argument to Figure() does change the figure size. Does this work for you -- you might have to change the wxversion.select() line, or just comment it out. If this works for you, can you post a simple, self-contained script that fails? Cheers, --Matt #!/usr/bin/env python import wxversion wxversion.select('2.5.3-mac-ansi') import wx print 'using wxPython version ', wx.__version__ import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.figure import Figure class SimpleFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1, 'wx Matplotlib Frame') self.figure = Figure(figsize=(5,3),dpi=96) self.axes = self.figure.add_subplot(111) 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|wx.EXPAND) self.SetSizer(self.sizer) self.Fit() class App(wx.PySimpleApp): def OnInit(self): frame = SimpleFrame() frame.Show(True) return True app = App(0) app.MainLoop() ############## |