Inverted imshow using Cairo backend #7156

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

Comments

Projects
None yet
2 participants
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.

Member

QuLogic commented Oct 10, 2016

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

Owner

tacaswell commented Oct 11, 2016

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.

tacaswell closed this Oct 11, 2016

Member

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.

Owner

tacaswell commented Oct 12, 2016

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