Skip to content

imshow does not immediately update shared axes #6922

@efiring

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions