一次显示几个数字 [英] Showing several figures at once

查看:85
本文介绍了一次显示几个数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请考虑一个名为a的matplotlib图形列表.我尝试一次将它们绘制在jupyter笔记本的单元格中,例如

Consider a list of matplotlib figures called a. I try to draw them at once writing in the cell of jupyter notebook something like

import matplotlib.pyplot as plt

%matplotlib inline

for fig in a:
  fig.show()

但是我无法在单元格输出中绘制任何数字. 在循环内或之后写入plt.show()是没有用的.

However I can't get any figures drawn in the cell output. Writing plt.show() inside the loop or after is useless.

如何正确执行此操作?

推荐答案

一个选项可能是使用display显示数字:

An option might be to use display to display the figures:

from IPython.core.display import display
for fig in a:
    display(fig)

这篇关于一次显示几个数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆