报错:
D:\Program Files\Anaconda3\lib\site-packages\matplotlib\figure.py:445: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so......
解决方法:
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
补充:Jupyter Notebook 插入图片的几种方法
一、通过HTML方式
插入本地图片
使用 img src> 语句插入本地图片,其中src为图片路径,可以是相对路径或绝对路径。
img src="./jupyter_logo.png", width=320, heigth=240>
上述语句为插入当前目录下名为“jupyter_logo.png”的图片,宽度设为320, 高度设为240。

如果不指定维度,则为原图大小。
插入网络图片
img src> 语句同样可以插入网络图片。
img src="http://jupyter.org/assets/main-logo.svg", width=320, heigth=240>

二、通过Markdown格式插入图片
插入图片的格式为:,其中,在图像显示错误的时候会显示图像标签的内容。
插入本地图片
需将图片源换成图片的本地路径,可以是绝对路径或相对路径。


如果我们将图片路径设置为一个不存在的路径,

则会显示图片标签,

插入网络图片
需将图像源设为图像网址,

显示如下

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。如有错误或未考虑完全的地方,望不吝赐教。
您可能感兴趣的文章:- Jupyter notebook 输出部分显示不全的解决方案
- 解决jupyter notebook启动后没有token的坑
- Python中Jupyter notebook快捷键总结
- 解决Jupyter-notebook不弹出默认浏览器的问题
- 终端能到import模块 解决jupyter notebook无法导入的问题
- Jupyter Notebook读入csv文件时出错的解决方案
- docker容器下配置jupyter notebook的操作
- jupyter notebook指定启动目录的方法
- 解决jupyter notebook图片显示模糊和保存清晰图片的操作