该FigureCanvasBase
类,位于每个后端有一个get_supported_filetypes
方法。
为backend_agg
:
figure = matplotlib.figure.Figure()
fcb = matplotlib.backends.backend_agg.FigureCanvasBase(figure)
supported_file_types = fcb.get_supported_filetypes()
supported_file_types
包含:
{'emf': 'Enhanced Metafile',
'eps': 'Encapsulated Postscript',
'pdf': 'Portable Document Format',
'png': 'Portable Network Graphics',
'ps': 'Postscript',
'raw': 'Raw RGBA bitmap',
'rgba': 'Raw RGBA bitmap',
'svg': 'Scalable Vector Graphics',
'svgz': 'Scalable Vector Graphics'}
剩下的一个问题.... matplotlib.get_backend()
回报"agg"
。有没有更简单的方法直接指向正确的后端模块?
来源
2011-09-30 09:09:15
ohe
不错的一个...没有看到图形对象上的这个画布属性。 – ohe
难以捉摸的魔法,它会在它愈合时燃烧。感谢你!我的Matplotlib工具腰带现在变平了。 –