Is it possible to set .pdf as defaut when saving an image?

Is it possible to set the extension .pdf as defaut when I save an
image using the matplotlib bar. My coworkers are always saving the
image in png and it's really ugly!

Thx,

Fab

Interesting request. Looking through the backends, it appears that only the Cairo backend currently supports a configurable rcParam for the default filetype (‘cairo.format’). All backends implement a “get_default_filetype()” method for their canvases, but most of them have that default hard-coded as “png”. This really only makes sense for backends like agg, pdf, ps and such.

Devs - Maybe we should consider fixing this for the non-fileformat specific backends? Do we want an rcParam for each backend? Or a single rcParam for default filetypes and deprecate ‘cairo.format’?

Cheers!

Ben Root

···

On Tue, Feb 7, 2012 at 8:33 AM, Fabien Lafont <lafont.fabien@…287…> wrote:

Is it possible to set the extension .pdf as defaut when I save an

image using the matplotlib bar. My coworkers are always saving the

image in png and it’s really ugly!

Thx,

Fab

I would definitely lean toward the latter – unify it under a single
rcParam.

Mike
···

On 02/07/2012 10:48 AM, Benjamin Root wrote:

    On Tue, Feb 7, 2012 at 8:33 AM, Fabien > Lafont <lafont.fabien@...287...> >         wrote:
      Is it possible to set the extension .pdf as defaut when I save

an

      image using the matplotlib bar. My coworkers are always saving

the

      image in png and it's really ugly!



      Thx,



      Fab
      Interesting request.  Looking through the backends, it appears

that only the Cairo backend currently supports a configurable
rcParam for the default filetype (‘cairo.format’). All
backends implement a “get_default_filetype()” method for their
canvases, but most of them have that default hard-coded as
“png”. This really only makes sense for backends like agg,
pdf, ps and such.

      Devs - Maybe we should consider fixing this for the

non-fileformat specific backends? Do we want an rcParam for
each backend? Or a single rcParam for default filetypes and
deprecate ‘cairo.format’?

Sorry for posting to an old thread, but I just submitted a pull request that implements this, AFAICT:

https://github.com/matplotlib/matplotlib/pull/907

Martin

···

On 12-02-07 08:40 AM, Michael Droettboom wrote:

On 02/07/2012 10:48 AM, Benjamin Root wrote:

On Tue, Feb 7, 2012 at 8:33 AM, Fabien Lafont >> <lafont.fabien@…287… >> <mailto:lafont.fabien@…287…>> wrote:

    Is it possible to set the extension .pdf as defaut when I save an
    image using the matplotlib bar. My coworkers are always saving the
    image in png and it's really ugly!

    Thx,

    Fab

Interesting request. Looking through the backends, it appears that only the
Cairo backend currently supports a configurable rcParam for the default
filetype ('cairo.format'). All backends implement a "get_default_filetype()"
method for their canvases, but most of them have that default hard-coded as
"png". This really only makes sense for backends like agg, pdf, ps and such.

Devs - Maybe we should consider fixing this for the non-fileformat specific
backends? Do we want an rcParam for each backend? Or a single rcParam for
default filetypes and deprecate 'cairo.format'?

I would definitely lean toward the latter -- unify it under a single rcParam.

Mike