Skip to content

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

Closed

Description

@anntzer

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:

Activity

  1. jklymak commented on Oct 25, 2019

    @jklymak
    Member

    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...

  2. anntzer commented on Oct 25, 2019

    @anntzer
    ContributorAuthor

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

  3. jklymak commented on Oct 25, 2019

    @jklymak
    Member

    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

  4. jklymak commented on Oct 25, 2019

    @jklymak
    Member

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

  5. added this to the v3.2.0 milestone on Oct 25, 2019
  6. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.topic: images

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions