from keras.datasets import mnist
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
ind = 10
digit = train_images[ind]
plt.imshow(digit, cmap=plt.cm.binary)
plt.show()
x = train_images[ind,7:-7, 7:-7]
plt.imshow(x, cmap=plt.cm.binary)
plt.show()

Two images are displayed in Plots page, if you want to pop up a new screen, try the following steps
Tools->Preferences

IPython console->Graphics->Graphics backen: Inline
That is the reason why the images are shown inline.

Change it to "Automatic" from "Inline"

Now a figure pops up automatically

請先 登入 以發表留言。