[IPython-dev] [Notebook 1.0.0] Display two png images side by side
zvoros at gmail.com
Mon Sep 2 10:03:49 EDT 2013
It might be a hack, but this works:
with open("roche1.png", "rb") as image_file:
im1 = 'data:image/png;base64,' + base64.b64encode(image_file.read())
with open("roche2.png", "rb") as image_file:
im2 = 'data:image/png;base64,' + base64.b64encode(image_file.read())
s = """<table>
On 02/09/13 15:32, Francesco Montesano wrote:
> Dear List,
> I have a script that produces some image and I'm creating a notebook
> for testing/logging.
> For comparison reasons, I would like to load to images in a cell and
> show them side by side.
> from IPython.display import Image
> constr = Image(filename="fig1.png")
> sigma = Image(filename="fig2.png")
> display(constr, sigma)
> put the figures one after the other. I've tried to play with the width
> keyword, but that does not help.
> Making an HTML table with the output of "Image" does not work (I don't
> know if I should add "of course")
> s = """<table>
> </tr>""".format(f1=constr, f2=sigma)
> Is there any way to do what I want directly in the notebook? (I guess
> that there is some python library to do it, but I think that the
> notebook should be able to do it)
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev