show image using matplotlib code example
Example 1: show image in matplotlib
%pylab inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('your_image.png')
imgplot = plt.imshow(img)
plt.show()
Example 2: show image in python
from PIL import Image
im = Image.open("sample-image.png")
im.show()
Example 3: python plot jpg image
%pylab inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('your_image.png')
imgplot = plt.imshow(img)
plt.show()