Improve docs for format determination in savefig()/imsave(). by anntzer · Pull Request #13260 · matplotlib/matplotlib · GitHub
Skip to content

Improve docs for format determination in savefig()/imsave(). - #13260

Merged
NelleV merged 1 commit into
matplotlib:masterfrom
anntzer:savefig-filetype-doc
Jan 23, 2019
Merged

NelleV merged 1 commit into
matplotlib:masterfrom
anntzer:savefig-filetype-doc

Conversation

@anntzer

@anntzer anntzer commented Jan 22, 2019

Copy link
Copy Markdown
Contributor

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 from format, 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

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Most importantly, the current backend is mostly irrelevant (unlike what
the docs state), because we handle backend switching transparently.

@NelleV NelleV left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@NelleV
NelleV merged commit 2660901 into matplotlib:master Jan 23, 2019
@QuLogic QuLogic added this to the v3.1 milestone Jan 23, 2019
@anntzer
anntzer deleted the savefig-filetype-doc branch January 23, 2019 07:22
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.

3 participants