|
From: Michiel de H. <mjl...@ya...> - 2010-11-17 23:30:37
|
--- On Wed, 11/17/10, Kynn Jones <ky...@gm...> wrote:
>From a figure object:
figure.canvas.get_supported_filetypes()
returns a dictionary of supported file extensions, with mapping to more
detailed descriptions of each.
Yes,
but this solves the problem only for the non-GUI backends. It does not
work for GUI backends, or at least for the MacOSX backend, which is the
only graphics backend that I've managed to get to work (despite of,
literally, days trying unsuccessfully to install other ones).
Works for me:
>>> import matplotlib
>>> matplotlib.use("MacOSX")
>>> from pylab import *
>>> f = figure()
>>> f.canvas.get_supported_filetypes()
{'svgz': 'Scalable Vector Graphics', 'ps': 'Postscript', 'emf': 'Enhanced Metafile', 'gif': 'Graphics Interchange Format', 'svg': 'Scalable Vector Graphics', 'eps': 'Encapsulated Postscript', 'jpeg': 'JPEG', 'raw': 'Raw RGBA bitmap', 'bmp': 'Windows bitmap', 'jpg': 'JPEG', 'rgba': 'Raw RGBA bitmap', 'tiff': 'Tagged Image Format File', 'pdf': 'Portable Document Format', 'tif': 'Tagged Image Format File', 'png': 'Portable Network Graphics'}
>>>
This does pop up a window though.
You should be able to use the non-interactive mode to do this without popping up a window. However, the non-interactive mode was never implemented for this backend. At least as I understood it, originally the main purpose of the non-interactive mode was to speed up drawing. In the MacOSX backend, interactive drawing was always equally fast as non-interactive drawing (nowadays this is also true for the other backends; at least I have not seen any examples of the contrary), which is why non-interactive drawing was not implemented in the MacOSX backend.
In principle the non-interactive mode can also be implemented in this backend. If that would solve your problem, could you open a bug report for it?
--Michiel.
|