如何确定 matplotlib 正在使用哪个后端?

matplotlibserver side programmingprogramming更新于 2025/5/12 23:37:17

使用 matplotlib.get_backend(),我们可以获取后端值。

步骤

  • 导入 matplotlib。

  • 要返回当前后端的名称,请使用 get_backend() 方法。

示例

import matplotlib
print("Backend used by matplotlib is: ", matplotlib.get_backend())

输出

Backend used by matplotlib is: GTK3Agg

相关文章