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

3d axes are collapsed by tight_layout #12239

Closed
Milestone
@adeak

Description

@adeak

Callingfig.tight_layout() on a figure with a 3dAxes inside will collapse the axes into a vertical line.

Minimal example:

import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dfor tighten in False,True:    fig = plt.figure()    ax = fig.add_subplot(111, projection='3d')    ax.plot([1,2], [1,2], [1,2])    if tighten:        fig.tight_layout()plt.show()

The following figures are produced with python 3.7, matplotlib 3.0.0 (also master):
figure without tight_layout: all's fine
figure with tight_layout: axes is a single vertical line

There's also a warning that says
/home/user/matplotlib-env/lib/python3.7/site-packages/matplotlib/tight_layout.py:177: UserWarning: The left and right margins cannot be made large enough to accommodate all axes decorations.
but that's hardly surprising since there's no room for any decorations whatsoever.

May or may not be related to the recent-ish issues fixed by#11739 and#11627.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp