I'm playing around with using Matplotlib in my PyGTK app, and keep
triggering a crash. I've narrowed it down to this bit of code:
from matplotlib.backends.backend_gtk import FigureCanvasGTK
from matplotlib.figure import Figure
def TestGraph(one, two, three):
figure = Figure()
ax1 = figure.add_subplot(111)
ax2 = ax1.twinx()
# Remove this line and it all works:
graph = TestGraph(
[[0,1,2],[0.1, 0.2, 0.35]],
window = gtk.Window()
def destroy(widget, data=None):
Running this gives me:
$ Projects/python-virt/bin/python mpltest.py
The program 'mpltest.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
(Details: serial 553 error_code 8 request_code 73 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Am I doing something obviously wrong? (Apart from the lack of plots, I
mean... I removed them because they didn't change the behaviour.)
This is under...
Matplotlib: SVN r8988