Skip to content

Instantly share code, notes, and snippets.

@malaikannan
Created January 26, 2017 05:54
Show Gist options
  • Save malaikannan/ff59c93804a90ff9a6c13bbfec729e83 to your computer and use it in GitHub Desktop.
Save malaikannan/ff59c93804a90ff9a6c13bbfec729e83 to your computer and use it in GitHub Desktop.
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# plot 4 images as gray scale
plt.subplot(221)
plt.imshow(X_train[20], cmap=plt.get_cmap('gray'))
plt.subplot(222)
plt.imshow(X_train[23], cmap=plt.get_cmap('gray'))
plt.subplot(223)
plt.imshow(X_train[42], cmap=plt.get_cmap('gray'))
plt.subplot(224)
plt.imshow(X_train[54], cmap=plt.get_cmap('gray'))
# show the plot
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment