Skip to content

Redrawing canvas causes subplot positions to change when aspect='equal' used with rcParams['figure.autolayout'] = True #7648

Description

@ndeadly

As the title states, subplots with equal aspect ratio drift around within the figure when the canvas is redrawn with figure.autolayout set. The following code demonstrates the issue

import matplotlib.pyplot as plt
plt.rcParams['figure.autolayout'] = True

fig = plt.figure()
ax1 = fig.add_subplot(121, aspect='equal')
ax2 = fig.add_subplot(122, aspect='equal')
fig.canvas.mpl_connect('button_press_event', lambda event: event.canvas.draw())
fig.canvas.set_window_title('Click to redraw canvas')
plt.show()

The issue doesn't appear to occur with the default figure size, but if you resize the window horizontally the subplots drift around with each redraw until eventually settling on a position.

Platform: Windows 7
matplotlib: 1.5.3
python: 2.7.12

Activity

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

    status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions