Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Closed as not planned
Labels
Milestone
Description
Consider an axis with equal aspect ratio
from matplotlib import pyplot as pltfig = plt.figure()ax1 = fig.add_subplot(111, aspect='equal')ax1.grid()plt.show()Adding a parasitic axis withtwinx() causes the plot to completely ignoreaspect='equal'
from matplotlib import pyplot as pltfig = plt.figure()ax1 = fig.add_subplot(111, aspect='equal')ax1.grid()ax2 = ax1.twinx()plt.show()Creating the primary axis with the keyword argumentadjustable='box-forced' causes it to obeyaspect='equal' but the parasitic axis does not.
from matplotlib import pyplot as pltfig = 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 withhost_subplot (noteadjustable='box-forced' is still required). However, it seems to be prone to a similar issue to#7648 iffigure.autolayout is set
import matplotlib.pyplot as pltfrom mpl_toolkits.axes_grid1 import host_subplotfig = 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



