Created
April 21, 2018 01:59
-
-
Save okdolly-001/f126fd8a527d654b3a4b327ce513d29d to your computer and use it in GitHub Desktop.
Display image and title #jupyter #matplotlib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set a subplots. Display image and title inside a for-loop. | |
%matplotlib inline | |
import matplotlib.pyplot as plt | |
from matplotlib.pyplot import imshow | |
fig, axs = plt.subplots(2,5, figsize=(15, 6), facecolor='w', edgecolor='k') | |
fig.subplots_adjust(hspace = .5, wspace=.001) | |
axs = axs.ravel() | |
for i in range(10): | |
axs[i].imshow(X_train[10*i+200]) | |
axs[i].set_title(str(y_train[10*i+200])) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment