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

Appearance settings

Conversation

@tacaswell
Copy link
Member

Closes #2831

Went with a purely documentation fix (and fleshed out the BBoxImage docs while I was at it).

PR checklist

@tacaswell tacaswell added this to the v3.11.0 milestone Apr 13, 2025
lib/matplotlib/artist.py Outdated Show resolved Hide resolved
lib/matplotlib/artist.py Outdated Show resolved Hide resolved
Comment on lines +350 to +353
To get accurate results you may need to manually call
`matplotlib.figure.Figure.savefig` or
`matplotlib.figure.Figure.draw_without_rendering` to have Matplotlib
compute the rendered size.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unclear to me. I feel, we are mixing two things here an it's too short to understand:

  1. draw_without_rendering ensures the window_extent is up-to-date for the current transform stack. This resolves incorrect intermediate state due to lazy evalutation, e.g. of the layout.
  2. How does savefig help here? Is this this the double save idea of Bug when saving to vector format (pdf, svg, eps) #2831 (comment). If so, that needs more explanation. Also I'm not sure on the generality of the solution Bug when saving to vector format (pdf, svg, eps) #2831 (comment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment over on #2831 for why in the case of vector backends we may need savefig (tl;dr: print_pdf changes the DPI).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this is too terse to be helpful and actionable for users. However, I won't block over this.

Decide yourself whether it's good enough for now or how much additional effort you want to put into this.

tacaswell and others added 2 commits April 14, 2025 09:08
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@tacaswell
Copy link
Member Author

I'm going to merge on @timhoffm 's approval. I do not disagree this is terse and vague, but I'm not sure how to make it less vague without making it way less terse.

@tacaswell tacaswell merged commit 956cc02 into matplotlib:main May 16, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug when saving to vector format (pdf, svg, eps)

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.