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]: Background of rotated png is rendered black #29300

Open
@maederan201

Description

@maederan201

Bug summary

If I rotate an image, the background of its bounding box is rendered black when rendering as .pdf or .png

Code for reproduction

importmatplotlib.pyplotaspltfrommatplotlib.transformsimportAffine2Dimportnumpyasnpimg=np.random.random((100,20,3))tr_rotate=Affine2D().rotate_deg_around(0/2,0/2,45)tr_translate=Affine2D().translate(250,250)fig,ax=plt.subplots()ax.imshow(img,transform=tr_rotate+ax.transData,clip_on=False,)ax.imshow(img,transform=tr_translate+ax.transData,clip_on=False,)ax.set_xlim(-250,500)ax.set_ylim(-250,500)fig.savefig("MWE.png")

Actual outcome

Image

Expected outcome

Transparent Bounding Box

Additional information

In the past this was possible, however I don't know which version of matplotlib was used...

Operating system

KDE Neon

Matplotlib Version

3.9.2

Matplotlib Backend

tkagg

Python version

3.12.3

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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