Thanks to visit codestin.com
Credit goes to github.com

Skip to content

antialiased image check seems wrong when used on zoomed image #15517

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
anntzer opened this issue Oct 25, 2019 · 4 comments · Fixed by #15519
Closed

antialiased image check seems wrong when used on zoomed image #15517

anntzer opened this issue Oct 25, 2019 · 4 comments · Fixed by #15519
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: images
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Oct 25, 2019

Bug report

Bug summary

The new antialiased image code appears to not handle zoomed images correctly.

attn @jklymak

Code for reproduction

from pylab import *
plt.rcdefaults()
fig, axs = plt.subplots(1, 2)
axs[0].imshow(np.random.rand(10, 10))  # now defaults to interpolation="antialiased"
axs[1].imshow(np.random.rand(1000, 1000))
axs[1].set(xlim=(-.5, 9.5), ylim=(-.5, 9.5))
plt.show()

Actual outcome

Run with mpl master (or anything after #13724 was merged).

test

Expected outcome

The right image should also be rendered using "nearest" interpolation.

Matplotlib version

  • Operating system: linux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): qt5agg
  • Python version: 37
  • Jupyter version (if applicable): no
  • Other libraries:
@jklymak
Copy link
Member

jklymak commented Oct 25, 2019

Fair enough, its because we use the actual data shape, not the visible data shape:

shape = list(data.shape)

I'm not quite sure how we can toggle between the two... I thought we had zooming working, but maybe I'm wrong...

@anntzer
Copy link
Contributor Author

anntzer commented Oct 25, 2019

Indeed, I somehow remember that we did check zooming, but heh...

@jklymak
Copy link
Member

jklymak commented Oct 25, 2019

The y transform isn't being applied properly. I'm just doing

shape = list(data.shape)
dispx, dispy = transform.transform([shape[1], shape[0]])

but I'm pretty sure shape[0] is not being transformed correctly to dispy

@jklymak
Copy link
Member

jklymak commented Oct 25, 2019

Ooops, I think I fixed it, but need to add this as a test.

@jklymak jklymak added this to the v3.2.0 milestone Oct 25, 2019
@jklymak jklymak added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: images
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants