如何在jupyter中并排显示两个本地图像? [英] How to display two local images side by side in jupyter?
本文介绍了如何在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?
这篇关于如何在jupyter中并排显示两个本地图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文