How to display two local images side by side in jupyter?

梦想的初衷 提交于 2019-12-11 12:18:24

问题


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.

The way I tried was:

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

But that did not work.

Any ideas how to solve this?

Thanks


回答1:


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.


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



来源:https://stackoverflow.com/questions/47637739/how-to-display-two-local-images-side-by-side-in-jupyter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!