Skip to content

hexbin_demo.py crashes with gtk backend #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2012

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Jun 11, 2012

the demo:
http://matplotlib.sourceforge.net/examples/pylab_examples/hexbin_demo.html
crashes in matplotlib 1.0.1 when using the gtk backend:

$ python hexbin.py -dgtk
The program 'hexbin.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 56509 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.)

other backends including gtkagg work fine.
downstream bug, verified with 1.0.1ubuntu1:
https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/782812

@mdboom
Copy link
Member

mdboom commented Jun 15, 2011

I believe this is just a limit on the number of points in a polygon in gdk. Not sure it's readily fixable.

@efiring
Copy link
Member

efiring commented Jun 16, 2011

I don't think that is the problem. It crashes the same way (but much quicker) if I set gridsize=5 (and reduce n to 1000).

@pelson
Copy link
Member

pelson commented Jun 9, 2012

Still prevalent on master. Interestingly doesn't occur on gtk3 backend.

@ghost ghost assigned mdboom Jun 11, 2012
@mdboom
Copy link
Member

mdboom commented Jun 11, 2012

Gtk+3 completely drops Gdk in favor of Cairo, so it's using a completely different rendering backend. I'm looking at this now.

@mdboom
Copy link
Member

mdboom commented Jun 11, 2012

Fix attached. The problem was actually in _draw_rotated_text when drawing off of the canvas. (So not directly related to hexbin). Underneath this of course is the larger problem that the Gdk backend doesn't support clipping, so the hexbin plot is rather ugly. That's not going to be easy to fix if at all. I'm personally in favor of gracefully deprecating the Gdk backend as Gdk itself is now deprecated as well.

@efiring
Copy link
Member

efiring commented Jun 12, 2012

I agree with the idea of phasing out the backend, if possible.

Is there a reason this check for out-of-bounds is needed only in _draw_rotated_text and not in draw_text, which also is already checking for negative x or y?

@mdboom
Copy link
Member

mdboom commented Jun 12, 2012

@efiring: Good point. I have made the analogous fix to _draw_text.

mdboom added a commit that referenced this pull request Jun 13, 2012
hexbin_demo.py crashes with gtk backend
@mdboom mdboom merged commit e3499bc into matplotlib:v1.1.x Jun 13, 2012
@richbwood richbwood mentioned this pull request Dec 19, 2012
@mdboom mdboom deleted the gtk-hexbin-crash branch March 3, 2015 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants