Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
The image
module in Matplotlib package provides various functions required for loading, rescaling and displaying image.
Loading image data is supported by the Pillow library. Natively, Matplotlib only supports PNG images.
First, we will import pyplot and image from matplotlib. We will also import numpy
import matplotlib.<< your code goes here >> as plt
import matplotlib.<< your code goes here >> as mpimg
import << your code goes here >> as np
Now we will read the image using the imread
function
path = 'https://cloudxlab.s3.amazonaws.com/static/images/aha/matplotlib/introduction_image.png'
img = mpimg.<< your code goes here >>(path)
And finally, we will display the image using imshow
function
imgplot = plt.imshow(img)
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...