Issue
If I do the following commands in iPython or just Python,
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img=mpimg.imread('stinkbug.png')
imgplot = plt.imshow(img)
then nothing happens (no image appear anywhere).
But if I do the following commands:
import scipy.misc as misc
img=misc.imread('stinkbug.png')
misc.imshow(img)
then image appears inside separate window of ImageMagick
.
Also, I can run ipython with qtconsole and will see image with first code.
What are the difference between two different ways of diplaying images? Can they be unified, i.e. work in similar way in both consoles? Is it possible to make first code work in normal ipython/python?
Solution
Add plt.show(imgplot)
at the end of your code.
Answered By - AlessioX
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.