How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?

后端 未结 15 1087
天命终不由人
天命终不由人 2020-11-30 16:12

I would like to include image in a jupyter notebook.

If I did the following, it works :

from IPython.display import Image
Image(\"img/picture.png\")
         


        
15条回答
  •  無奈伤痛
    2020-11-30 16:53

    I know this is not fully relevant, but since this answer is ranked first many a times when you search 'how to display images in Jupyter', please consider this answer as well.

    You could use matplotlib to show an image as follows.

    import matplotlib.pyplot as plt
    import matplotlib.image as mpimg
    image = mpimg.imread("your_image.png")
    plt.imshow(image)
    plt.show()
    

提交回复
热议问题