Is it possible to display images in IPython (or Jupyter) console?

214 views Asked by At

I have just discovered that there are tools that allow embedding images into terminals, like these ones.

I am wondering if there is a IPython (or, more generally jupyter console) builtin function that allows to do the same. That would be handy for displaying plots inline.

I know you could do that with QtConsole, but that is not really a terminal.

1

There are 1 answers

0
Memristor On

Not directly in your console but in a new window:

import matplotlib.pyplot as plt
import matplotlib.image as mpimg

image = mpimg.imread('path/to/your/image.png')

# Display the image
plt.imshow(image)
plt.axis('off')  # remove the axis
plt.show()