From: Fernando P. <Fer...@co...> - 2006-01-25 19:08:11
|
Ted Drain wrote: > Maybe one of you guys could refresh my memory. What is the calling > sequence we're going for? My original message was this: ============================================================================ In [1]: gcf().set_figsize_inches((8,8),forward=True) --------------------------------------------------------------------------- exceptions.TypeError Traceback (most recent call last) /home/fperez/code/python/pylab/arrows/<ipython console> /usr/lib/python2.3/site-packages/matplotlib/figure.py in set_figsize_inches(self, *args, **kwargs) 266 canvasw = w*dpival 267 canvash = h*dpival --> 268 self.canvas.resize(int(canvasw), int(canvash)) 269 270 def get_size_inches(self): TypeError: resize() takes exactly 2 arguments (3 given) A quick look at the backends code shows this: def resize(self, event): width, height = event.width, event.height self.toolbar.configure(width=width) # , height=height) So quite obviously, this doesn't work: it's expecting an event object, and a pair of numbers is being passed. I'm not sure what the proper fix should be here, I don't really know the code flow well enough. I should also note that the gcf().set_figsize_inches((8,8),forward=True) seems to produce a different on-screen result per backend (in some it doesn't do anything, in Qt it stretches the figure only horizontally, ...) That code seems to be pretty much broken. I noticed that figure(figsize=(8,8)) seems to work fine, but I'm not sure how to programmatically resize an existing figure, given the above problems. ============================================================================ Beyond this, I'll leave it to the backend experts as to what the right choices should be. I just noted that shipping a feature _known_ to break on all but one backend doesn't sound like the best approach :) Cheers, f |