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
Segmentation Fault on adding BBoxImage to matshow #2963
Comments
what version of mpl are you using and how did you install it? |
I'm using the one in the ubuntu repositories, 1.1.1rc |
I can not reproduce this with a current version of mpl. Does |
No, Upgrading to |
What backend are you using? Is there anything peculiar about your system? Any non-standard libraries installed? What version of |
It's a pretty fresh install of Ubuntu 12.04, fast workstation (12 cores, 128GB RAM). Can't think of any unusual libraries. Here is a full |
never mind, I can reproduce this. I miss understood the OP |
And here is a full Seems the last thing it does is call Cairo. If I repeat the last statement:
But the debug output for working version, with |
It happens with |
As far as I can tell, the critical difference between using That makes sense (to me at least), as well as the resulting transform of the corners having inverted y values. One fix to the example given, suggesting BboxImage doesn't handle inverted Bboxes in this case:
Note: the firefox image shows up somewhere else (the values of lowerCorner, upperCorner were, before this change, [402.4, 501.6] and [412.8, 489.6]). It may just require a simple fix somewhere in BboxImage, but I didn't investigate any further. I did try changing this code (in BboxImage's constructor)
to
and it seemed to work (all tests passed). This is just speculation but there may be a C loop underneath tkinter of the form
which uses the bbox returned from As for an actual fix, you'd need to test for |
I am suspicious that it is rooted in tinker because I see it in Qt4, which should not be touching tk. |
Thanks @solvents, that works for me. I didn't think of the inverted axis. |
Image::resize will now raise a runtime error if the user passes in an invalid width or height. BboxImage.make_image will now ensure that the width and height it passes to Image::resize are positive or zero. BboxImage.draw will now calculate the bottom left corner of its Bbox, rather than using the "first" corner of its Bbox.
Image::resize will now raise a runtime error if the user passes in an invalid width or height. BboxImage.make_image will now ensure that the width and height it passes to Image::resize are positive or zero. BboxImage.draw now calculates the bottom left corner of its Bbox, rather than using the "first" corner of its Bbox.
Closing as #3009 has been merged. |
I am trying to add an image to axes with matshow() but getting
Segmentation fault (core dumped)
(no stacktrace). When replacing the matshow with a simple e.g. plot(range(10)), it works as expected.Thanks for matplotlib!
Jasper
The text was updated successfully, but these errors were encountered: