embedding in wx segfault

Hi I have a variant of the embedding_in_wx script that

    > worked fine on my previous version of matplotlib. Now,
    > with version 0.51 it's seg faulting. I updated the script
    > to reflect the changes in the library but still... Can
    > anyone see what may be going wrong?

There are lots of problems, which you would have caught if the normal
python exception mechanism worked with wx. pychecker caught a few -
the following are all fatal:

    PlotFigure.py:108: self is not first method argument
    PlotFigure.py:114: No global (self) found
    PlotFigure.py:123: No global (priors) found
    PlotFigure.py:124: No global (liks) found

There are other problems that pychecker didn't catch

        sizer.Add(self.fig, 1, wxLEFT|wxTOP|wxGROW)
                    ^^ self.canvas # part of the new 0.50 API change

and replace
        for i in range(nvar):
            a.plot (x,y[0][:,i])


        for row in y:
            a.plot(x, row)

Here is a modified script that runs; I just did a return above the
first use of priors and liks because there is no way to deal with them

PlotFigure.py (4.79 KB)