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]: Rasterized Artists inDrawingArea will be misplaced in the vectorized backend #28549

Open
@Mr-Milk

Description

@Mr-Milk

Bug summary

If I rasterized artists inDrawingArea, they are rendered correctly in rasterized backend but will be misplaced in the vectorized backend

Code for reproduction

importmatplotlib.pyplotaspltfrommatplotlib.offsetboximportAnchoredOffsetbox,DrawingAreafrommatplotlib.patchesimportRectanglefrommatplotlib.collectionsimportPatchCollectionforbackendin ["png","pdf","svg"]:forrasterizedin [True,False]:fig,ax=plt.subplots(figsize=(2,2))box=DrawingArea(10,10)rects=PatchCollection([Rectangle((0,i),width=10,height=1,ec="red")foriinrange(10)        ])rects.set_rasterized(rasterized)box.add_artist(rects)canvas=AnchoredOffsetbox(child=box,loc="center",pad=0)ax.add_artist(canvas)fig.savefig(f"DA_rasterized={rasterized}.{backend}")

Actual outcome

When setrasterized=True and in backendsvg orpdf:
image

In other situations, it's properly render:
image

Expected outcome

This is expected in any situation:
image

Additional information

No response

Operating system

OS/X arm

Matplotlib Version

3.9.1

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.10.13

Jupyter version

4.1.1

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