如何在jupyter中并排显示两个本地图像?

问题描述:

我要显示两个图像,我将它们本地保存在一个单独的缩小单元格中并排?我找到了以前的

I want to display two images, that I have them saved locally, in one single makedown cell side-by-side? I found previous post but it uses HTML() not Image() method.

我尝试的方式是:

from IPython.core.display import Image, display
display(Image('/whateverfile/counts1.png',width=100,height=100), Image('/whateverfile/counts2',width=100, height=100))

但是那没用.

有什么办法解决这个问题吗?

Any ideas how to solve this?

谢谢

from IPython.display import HTML, display
display(HTML("<table><tr><td><img src='/image/counts1.png'></td><td><img src='/image/counts2'></td></tr></table>"))

根据需要设置其他参数.

Set other parameters as you like.

或者也许使用nbextensions并将单元格拆分为两个(并排有2个输出)会满足您的需求?

Or maybe using nbextensions and splitting the cell in two (having 2 outputs side by side) would fit your needs?