Issue
I am trying to use The Ipython library to display some PNGs I have stored in another folder. Usually all I have to do is:
from IPython.display import Image
img = 'images/giraffe.png'
Image(url=img)
and that will display the giraffe. However, If I try to load up 2 images within a cell, it will just load the image that was last called.
from IPython.display import Image
img1 = 'images/giraffe.png'
Image(url=img1)
img2 = 'images/monkey.png'
Image(url=img2)
If I do that, all that will load is the png of the monkey.
I tried doing it with Matplotlib, but that adds x and y-axis ticks to the png, which is not appropriate for this case.
Solution
Have you tried using combination of Image
and display
?
from IPython.display import display, Image
i1 = Image("images/giraffe.png")
i2 = Image('images/monkey.png')
display(i1, i2)
Answered By - Kamil Niski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.