Skip to content

Instantly share code, notes, and snippets.

@nogawanogawa
Created April 8, 2018 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogawanogawa/b0bd2d78843e52c3262891d016514d7e to your computer and use it in GitHub Desktop.
Save nogawanogawa/b0bd2d78843e52c3262891d016514d7e to your computer and use it in GitHub Desktop.
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