Created
April 8, 2018 02:51
-
-
Save nogawanogawa/b0bd2d78843e52c3262891d016514d7e to your computer and use it in GitHub Desktop.
This file contains 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
import matplotlib.pyplot as plt | |
import matplotlib.gridspec as gridspec | |
# 縦横10枚ずつ画像を描画 | |
def plot(samples): | |
fig = plt.figure(figsize=(10, 10)) | |
gs = gridspec.GridSpec(10, 10) | |
gs.update(wspace=0.05, hspace=0.05) | |
for i, sample in enumerate(samples): | |
ax = plt.subplot(gs[i]) | |
plt.axis('off') | |
ax.set_xticklabels([]) | |
ax.set_yticklabels([]) | |
ax.set_aspect('equal') | |
plt.imshow(sample.reshape(3,32, 32).transpose(1, 2, 0)) | |
return fig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment