Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

aspect='equal' ignored when parasitic axis added with twinx/twiny #7654

Closed as not planned
Assignees
efiring
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesstatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action
@ndeadly

Description

@ndeadly

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()

figure_1-5


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()

figure_1-6


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()

figure_1-7


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()

figure_1-8

Platform: Windows 7
matplotlib: 1.5.3
python: 2.7.12

Metadata

Metadata

Assignees

Labels

Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesstatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp