AttributeError: 'FigureCanvasWxAgg' object has no attribute 'SetInitialSize'

I didn't check the example (from openopt) regularly. So I can't tell you when it stopped.

As a workaround I have used another backend in my

# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg
# Agg Cairo GD GDK Paint PS PDF SVG Template
#backend : WXAgg
backend : TkAgg


On Mon, 09 Jun 2008 07:41:05 -1000 Eric Firing <efiring@...229...> wrote:

Nils Wagner wrote:

Hi Eric,

I have still some trouble with the following example taken from openopt

/usr/bin/python -i
starting solver ipopt (license: CPL) with problem nlp3
[PyIPOPT] Ipopt will use Hessian approximation.
[PyIPOPT] nele_hess is 0
iter objFunVal log10(maxResidual)
    0 -1.640e+02 0.81
Traceback (most recent call last):
  File "", line 65, in ?
    r = p.solve(solver)
  File "/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/", line 236, in solve
    return runProbSolver(self, solvers, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/", line 219, in runProbSolver
  File "/usr/lib/python2.4/site-packages/scikits/openopt/solvers/CoinOr/", line 70, in __solver__
  File "/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/", line 57, in <lambda>
    self.iterfcn = lambda *args: ooIter(self, *args)# this parameter is only for OpenOpt developers, not common users
  File "/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/", line 78, in ooIter
    for df in df(p)
  File "/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/", line 127, in oodraw
    if self.nSubPlots>1: pylab.subplot(self.nSubPlots, 1, 1)
  File "/usr/lib/python2.4/site-packages/matplotlib/", line 519, in subplot
    fig = gcf()
  File "/usr/lib/python2.4/site-packages/matplotlib/", line 210, in gcf
    return figure()
  File "/usr/lib/python2.4/site-packages/matplotlib/", line 195, in figure
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/", line 119, in new_figure_manager
    frame = FigureFrameWxAgg(num, fig)
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/", line 1237, in __init__
    self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
AttributeError: 'FigureCanvasWxAgg' object has no attribute 'SetInitialSize'

Any idea ?

No clue. When did it stop working?

efiring@...340...:~/programs/py/mpl/mpl_trunk/lib/matplotlib$ rgrep SetInitialSize --include '*.py' .
./backends/ self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
./backends/ self.canvas.SetInitialSize(wx.Size(width, height))

I can't find anything in the code that defines SetInitialSize.