Bug summary
This bug occurs when I create a subplot with twin axes. Setting the aspect of axes from 'auto' to 'equal' works fine, but resetting the aspect back to 'auto' does not work.
Code for reproduction
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot()
ax_twin = ax.twinx() # No bug if I remove this
ax.plot([0, 1, 2], [0, 2, 1])
ax.set_aspect('auto')
plt.savefig('plot1.png')
ax.set_aspect('equal')
plt.savefig('tmp.png') # No bug if I remove this
ax.set_aspect('auto')
plt.savefig('plot2.png') # plot2.png should be the same as plot1.png
Actual outcome
plot1.png
plot2.png
Expected outcome
plot2.png should be the same as plot1.png
Additional information
No response
Operating system
No response
Matplotlib Version
3.10.8
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
Bug summary
This bug occurs when I create a subplot with twin axes. Setting the
aspectof axes from'auto'to'equal'works fine, but resetting theaspectback to'auto'does not work.Code for reproduction
Actual outcome
plot1.png
plot2.png
Expected outcome
plot2.png should be the same as plot1.png
Additional information
No response
Operating system
No response
Matplotlib Version
3.10.8
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None