I want to display 2 PNG images in iPython side by side.
My code to do this is:
from IPython.display import Image, HTML, display
img_A = '\path\to\img_A.png'
img_B = '\path\to\img_B.png'
display(HTML("<table><tr><td><img src=img_A></td><td><img src=img_B></td></tr></table>"))
But it doesn't output the images, and instead only displays placeholders for the 2 images:
I tried the following as well:
s = """<table>
<tr>
<th><img src="%s"/></th>
<th><img src="%s"/></th>
</tr></table>"""%(img_A, img_B)
t=HTML(s)
display(t)
But the result is the same:
The images are in the path for sure, because I verified by displaying them in a pop up:
plt.imshow(img_A)
plt.imshow(img_B)
and they do appear in the pop ups.
How do I make the 2 images appear side by side in iPython?