所有可用的matplotlib后端列表 [英] List of all available matplotlib backends

查看:116
本文介绍了所有可用的matplotlib后端列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前后端名称可通过


>>> import matplotlib.pyplot as plt
>>> plt.get_backend()
'GTKAgg'

是否可以获取可在特定计算机上使用的所有后端的列表?

Is there a way to get a list of all backends that can be used on a particular machine?

推荐答案

您可以访问列表

matplotlib.rcsetup.interactive_bk
matplotlib.rcsetup.non_interactive_bk
matplotlib.rcsetup.all_backends

第三个是前两个的串联.如果我正确地阅读了源代码,则这些列表是经过硬编码的,并且不会告诉您实际上可以使用哪些后端.还有

the third being the concatenation of the former two. If I read the source code correctly, those lists are hard-coded though, and don't tell you what backends are actually usable. There is also

matplotlib.rcsetup.validate_backend(name)

但这也只能对照硬编码列表进行检查.

but this also only checks against the hard-coded list.

这篇关于所有可用的matplotlib后端列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆