Skip to content

imshow does not immediately update shared axes #6922

Closed

Description

@efiring

On master:

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax1 = fig.add_axes([0.1, 0.1, 0.2, 0.2])
ax2 = fig.add_axes([0.35, 0.35, 0.6, 0.6], sharex=ax1, sharey=ax1)
ax3 = fig.add_axes([0.1, 0.35, 0.2, 0.6], sharex=ax1, sharey=ax1)
ax1.plot([1, 10])
ax2.plot([2, 20])
# ax3.plot([3, 30])
ax3.imshow(np.random.randn(10, 10))

plt.show()

The two axes with the lines do not react to the changed xlim and ylim from the imshow call until one forces a redraw, such as by resizing the window or using a zoom tool.
This problem turned up in #6759.

Activity

  1. jenshnielsen commented on Aug 8, 2016

    @jenshnielsen
    Member

    Does it apply to 2.x too?

  2. efiring commented on Aug 8, 2016

    @efiring
    MemberAuthor

    On 2016/08/07 9:01 PM, Jens Hedegaard Nielsen wrote:

    Does it apply to 2.x too?

    Yes, I checked just now with the latest 2.x and the result is the same.

  3. added this to the milestone on Aug 8, 2016
  4. efiring commented on Aug 8, 2016

    @efiring
    MemberAuthor

    Possibly related to #6890.

  5. efiring commented on Aug 8, 2016

    @efiring
    MemberAuthor

    Unfortunately, applying #6890, at least in its present form, does not solve the problem.

  6. efiring commented on Aug 8, 2016

    @efiring
    MemberAuthor

    The behavior is the same in mpl 1.5.1, so it is not a regression. I don't consider it a blocker. I'm going to shift the milestone.

  7. modified the milestones: , on Aug 8, 2016
  8. modified the milestones: , on May 3, 2017
  9. modified the milestones: , on Oct 9, 2017
  10. dstansby commented on Sep 24, 2018

    @dstansby
    Member

    This looks fixed on master to me; feel free to re-open if it's still a problem.

  11. removed this from the future releases milestone on Oct 6, 2022
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions