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:

----
import pygtk
import gtk

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:
    ax2.set_ylabel("Y")
    return FigureCanvasGTK(figure)

graph = TestGraph(
                [[0,1,2],[0.1, 0.2, 0.35]],
                [[0,1,2],[9,22,29]],
                [[0,1,2],[10,20,30]])

window = gtk.Window()
window.add(graph)

def destroy(widget, data=None):
    gtk.main_quit()

window.connect('destroy', destroy)
window.show_all()
gtk.main()
----

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...
Debian Squeeze/Wheezy/Sid
Python: 2.6.5
Matplotlib: SVN r8988
GTK: 2.20.1
PyGTK: 2.17.0

Cheers,
Jason

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to