How can I display an image imported with numpy package using matplotlib in ipython?
It should be fairly easy with the command
import numpy as np
import matplotlib.pyplot as plt
im = np.array(Image.open('image.jpg'))
plt.imshow(im)
But the image does not show and I just get the output
<matplotlib.image.AxesImage at 0x7fb38e10ff10>
You must call plt.show()
to actually bring up the windows.
You can get around this by using interactive mode. But for scripts it is better to simply call show()
after completing all your plotting commands.