Skip to content

Commit 132fcb7

Browse files
committed
MAINT: Update mnist plt patterns.
1 parent cca885c commit 132fcb7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

content/tutorial-deep-learning-on-mnist.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ import matplotlib.pyplot as plt
166166
# Take the 60,000th image (indexed at 59,999) from the training set,
167167
# reshape from (784, ) to (28, 28) to have a valid shape for displaying purposes.
168168
mnist_image = x_train[59999, :].reshape(28, 28)
169+
170+
fig, ax = plt.subplots()
169171
# Set the color mapping to grayscale to have a black background.
170-
plt.imshow(mnist_image, cmap="gray")
171-
# Display the image.
172-
plt.show()
172+
ax.imshow(mnist_image, cmap="gray")
173173
```
174174

175175
```{code-cell}
@@ -586,7 +586,6 @@ for ax, metrics, title in zip(
586586
ax.set_title(title)
587587
ax.set_xlabel("Epochs")
588588
ax.legend()
589-
plt.show()
590589
```
591590

592591
_The training and testing error is shown above in the left and right

0 commit comments

Comments
 (0)