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]: PaddedBox not working #24620

Open
Open
@oscargus

Description

@oscargus

Bug summary

PaddedBoxhttps://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.PaddedBox doesn't look like it is working properly.

Code for reproduction

importmatplotlib.pyplotaspltfrommatplotlib.offsetboximportPaddedBox,AnchoredTextfig,ax=plt.subplots()at=AnchoredText("foo",'upper left')pb=PaddedBox(at,pad=1,patch_attrs={'facecolor' :'r'},draw_frame=True)ax.add_artist(pb)fig.show()

Actual outcome

paddedbox

Expected outcome

Red box is at same location as text.

Additional information

It seems like the sizing is working OK (using a longer string will change the size accordingly), but that the positioning is not working.

Also, not passingpad leads to an error, so it should probably be 0. as default rather thanNone.

Operating system

No response

Matplotlib Version

main

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

git checkout

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