python - 我无法从 jupyter 笔记本中的 matplotlib.pyplot 关闭无花果
问题描述
windows python 3.7.3 matplotlib 3.0.3
for raw_name in img_list:
img1 = np.asarray(Image.open(os.path.join(ROOT, raw_name)))
img2 = np.asarray(Image.open(os.path.join(ROOT, raw_name.replace('.jpg', '.png'))))
f, axarr = plt.subplots(1, 2, dpi=400, frameon=False, gridspec_kw={'width_ratios': [6, 1]})
plt.ion()
axarr[0].imshow(img1)
plt.axis('off')
axarr[1].imshow(img2)
plt.axis('off')
plt.show(block=False)
plt.close('all')
我想在每个循环中显示图像并通过在每个循环结束时关闭绘图来刷新输出。但结果只是一张一张地显示图像。谁能告诉我如何关闭 jupyter notebook 中的情节?
解决方案
推荐阅读
- vue.js - 如何渲染一个包含 3 个项目和 2 列的循环,其中 1 个在第一列,另外 2 个在第 2 列?
- c++11 - 自己声明结构?
- oracle - 将 Informix 查询转换为 Oracle?
- vba - 循环遍历“条形样式”中的项目,阅读项目
- android - Android Google Play 商店应用程序不兼容 64 位
- unity3d - 如何更改附加了动画师的 UI 图像?
- ibm-cloud - Watson Assistant:我可以使用示例中的实体来定义意图吗?
- python - 使用 python pandas 将现有的 excel 表附加到新的数据框,而不加载旧的
- java - 在不和谐机器人上上传用户文件
- azure - HeadNode,workers Azure 中的节点大小详细信息