| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
... by forcing pdf backend output from within PdfPages.
| try: | ||
| orig_canvas = figure.canvas | ||
| figure.canvas = FigureCanvasPdf(figure) | ||
| figure.savefig(self, format="pdf", **kwargs) |
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?
Sorry, something went wrong.
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.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
... 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