Merged
Conversation
697f479 to
170d569
Compare
... by forcing pdf backend output from within PdfPages.
170d569 to
ec68069
Compare
OceanWolf
reviewed
Sep 1, 2017
| try: | ||
| orig_canvas = figure.canvas | ||
| figure.canvas = FigureCanvasPdf(figure) | ||
| figure.savefig(self, format="pdf", **kwargs) |
Member
There was a problem hiding this comment.
What if we were already using the pdf backend? How much extra work would this create? Does the new canvas need to get explicitly destroyed to free memory?
Contributor
Author
There was a problem hiding this comment.
Creating the FigureCanvasPdf is really cheap (it is defined just below -- its init is directly inherited from FigureCanvasBase, which doesn't do anything fancy either).
The temporary canvas will get GC'd per normal python semantics.
QuLogic
approved these changes
Feb 3, 2018
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.
... by forcing pdf backend output from within PdfPages.
Fixes #9112. No tests because the only realistic use case is with cairo, which is not tested either (but #9112 is fixed when manually trying it).
Attn @OceanWolf
PR Summary
PR Checklist