DOC: add warnings about get_window_extent and BboxImage#29910
Merged
tacaswell merged 3 commits intomatplotlib:mainfrom May 16, 2025
Merged
DOC: add warnings about get_window_extent and BboxImage#29910tacaswell merged 3 commits intomatplotlib:mainfrom
tacaswell merged 3 commits intomatplotlib:mainfrom
Conversation
timhoffm
reviewed
Apr 13, 2025
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. |
Member
There was a problem hiding this comment.
This is unclear to me. I feel, we are mixing two things here an it's too short to understand:
draw_without_renderingensures 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.- How does
savefighelp 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).
Member
Author
There was a problem hiding this comment.
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).
Member
There was a problem hiding this comment.
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.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
timhoffm
approved these changes
Apr 16, 2025
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2831
Went with a purely documentation fix (and fleshed out the
BBoxImagedocs while I was at it).PR checklist