如何检索Matplotlib savefig()函数支持的文件格式的列表? [英] How to retrieve the list of supported file formats for Matplotlib savefig() function?
本文介绍了如何检索Matplotlib savefig()函数支持的文件格式的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
savefig()
函数的文件文档说,支持的文件格式列表取决于使用的后端.如何获得特定后端支持的图像格式列表?
The documentation of savefig()
function says that the list of supported file formats depends on the used backend. How can I get this list of supported image formats for a specific backend?
推荐答案
你只需要问canvas
:
plt.gcf().canvas.get_supported_filetypes()
或
plt.gcf().canvas.get_supported_filetypes_grouped()
这篇关于如何检索Matplotlib savefig()函数支持的文件格式的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文