Improve docs for format determination in savefig()/imsave(). #13260
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.
Most importantly, the current backend is mostly irrelevant (unlike what
the docs state), because we handle backend switching transparently.
Preliminary work for #13253 (comment).
Note that the actual behavior is actually slightly different from the documented one: if the active canvas is PDF, PS or SVG and a format cannot be derived from
fname
or fromformat
, then the format used will be pdf/ps/svg (respectively) rather than rcParams["savefig.format"]. I would like to change that to instead always use the rcParam, but that'll wait for #12760 first (for rebase reasons). (Why allow saving to png when using a pdf canvas? Because to me that's similar as allowing to save to pdf when using an agg (=raster) canvas, and transparently handling the backend switching.)PR Summary
PR Checklist