Closed as not planned
Description
Consider an axis with equal aspect ratio
from matplotlib import pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111, aspect='equal')
ax1.grid()
plt.show()
Adding a parasitic axis with twinx()
causes the plot to completely ignore aspect='equal'
from matplotlib import pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111, aspect='equal')
ax1.grid()
ax2 = ax1.twinx()
plt.show()
Creating the primary axis with the keyword argument adjustable='box-forced'
causes it to obey aspect='equal'
but the parasitic axis does not.
from matplotlib import pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111, adjustable='box-forced', aspect='equal')
ax1.grid()
ax2 = ax1.twinx()
plt.show()
Interestingly, everything works if the primary axis is created with host_subplot
(note adjustable='box-forced'
is still required). However, it seems to be prone to a similar issue to #7648 if figure.autolayout
is set
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
fig = plt.figure()
ax1 = host_subplot(111, adjustable='box-forced', aspect='equal')
ax1.grid()
ax2 = ax1.twinx()
plt.show()
Platform: Windows 7
matplotlib: 1.5.3
python: 2.7.12