【问题标题】:PyPlot figure not shown in VS Code Jupyter "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure."PyPlot 图未在 VS Code Jupyter 中显示\“用户警告:Matplotlib 当前正在使用 agg,这是一个非 GUI 后端,因此无法显示该图。\”
【发布时间】:2022-11-10 07:38:01
【问题描述】:
我在 Microsoft Visual Studio Code 中运行 Julia Jupyter notebook。
当我尝试制作 PyPlot 图时,根本没有显示该图,而是看到以下消息:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
【问题讨论】:
标签:
visual-studio-code
jupyter-notebook
julia
【解决方案1】:
该图将在单元格代码末尾添加PyPlot.display_figs() 行时显示(注意display_figs 方法未导出,因此需要在前面加上PyPlot)。
请注意,我在某些 VS Code 安装中不时观察到这种情况发生,因此我在此处发布了此解决方法,以便其他人可以轻松地在 Google 上搜索它。