Skip to content

Inverted imshow using Cairo backend #7156

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

Closed
QuLogic opened this issue Sep 22, 2016 · 4 comments
Closed

Inverted imshow using Cairo backend #7156

QuLogic opened this issue Sep 22, 2016 · 4 comments
Milestone

Comments

@QuLogic
Copy link
Member

QuLogic commented Sep 22, 2016

In testing some stuff for #7151, I realized that the Cairo backend inverts images plotted using imshow.

import matplotlib as mpl
mpl.use('Cairo')
import numpy as np
import matplotlib.pyplot as plt

a = np.random.randn(3,3)

im1 = plt.imshow(a, extent = [0,1,0,1])
plt.xlim(0,2.2)
plt.ylim(0,2.2)

plt.savefig('test.png')

It doesn't really matter if saving as png or pdf, the outcome is the same. With Agg, the image appears in the lower left corner:
test
With Cairo, the image appears in the upper left corner:
test

It worked correctly with mpl 1.4.3 and is broken with 1.5.0, but bisection is next to impossible because the Cairo backend was broken for a very long time.

@QuLogic
Copy link
Member Author

QuLogic commented Oct 10, 2016

I'm going to ping @jenshnielsen who seems to have last had contact with the cairo backend.

@tacaswell tacaswell added this to the 2.0 (style change major release) milestone Oct 11, 2016
@tacaswell
Copy link
Member

I can not reproduce this on 2.x with py3.5 and cairocffi

test

Please ping to have this re-opened if there is some combination of 2.x + py + cairo binding that fails.

@QuLogic
Copy link
Member Author

QuLogic commented Oct 12, 2016

Oh, I thought I tested with v2.x at some point, but it looks like you're right. It appears to have been fixed with the ever-growing list of things from #5718.

@tacaswell
Copy link
Member

The dragon infested rabbit holes are paying for them selves in recovered technical debt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants