用于在 jupyter 中进行内联绘图的 matplotlib 后端是什么

What is the backend of matplotlib for inline plotting in jupyter

我想实现一个matplotlib的自定义后端,所以我想阅读一下jupyter中内联绘图的matplotlib后端代码以供参考。谁能指出我的源代码?谢谢

您可以通过以下方式获取已使用的后端:

%pylab inline
matplotlib.get_backend()

>> 'module://ipykernel.pylab.backend_inline'

查看该模块中的源代码表明后端是从 matplotlib.backends.backend_agg

导入的

matplotlibrc file 的帮助也有一些指定新后端的信息。

# The default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo
# MacOSX Qt4Agg Qt5Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG
# Template.
# You can also deploy your own backend outside of matplotlib by
# referring to the module name (which must be in the PYTHONPATH) as
# 'module://my_backend'.
backend      : qt5agg