matplotlib.pyplot.switch_backend#

matplotlib.pyplot.switch_backend(newbackend)[源代码][源代码]#

设置 pyplot 后端。

只有在没有启动其他交互式后端的事件循环时,才可能切换到交互式后端。切换到非交互式后端和从非交互式后端切换总是可能的。

如果新的后端与当前后端不同,则所有打开的图形将通过 plt.close('all') 关闭。

参数:
新后端str

要使用的后端的不区分大小写的名称。