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

[Bug]: annotation in figure fraction cropped out from bbox_tight #25189

Open
@ogeesan

Description

@ogeesan

Bug summary

Annotations placed outside of an axes withxycoords='figure fraction' are not respected byfig.save_fig(bbox_inches='tight')

Code for reproduction

plt.plot([1,2])figannot=plt.annotate('figure fraction annotation', (0.2,0.97),xycoords='figure fraction')axesannot=plt.annotate('axes fraction annotation', (0.2,1.05),xycoords='axes fraction')plt.gcf().savefig('test.svg',bbox_inches='tight')

Actual outcome

annotation_example_inkscape
This is a screenshot from Inkscape.

Expected outcome

The annotation using figure fraction should get the same treatment as the annotation using axes fraction.

Additional information

The figure fraction annotation returns aBbox withget_window_extent so it beats me.

The effects of this bug are pretty dramatic if leaving a lot of empty space in a figure window (e.g.add_axes((0.1, 0.5, 0.1, 0.4))).

Operating system

Windows

Matplotlib Version

3.6.3

Matplotlib Backend

Qt5Agg

Python version

Python 3.8.3

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp