Skip to content

Instantly share code, notes, and snippets.

@karthikziffer
Last active November 14, 2019 11:31
Show Gist options
  • Save karthikziffer/1b76705aede825ac3f269fcd62acede8 to your computer and use it in GitHub Desktop.
Save karthikziffer/1b76705aede825ac3f269fcd62acede8 to your computer and use it in GitHub Desktop.
Visualize images from loop using matplotlib subplot
import matplotlib.pyplot as plt
fig = plt.figure(figsize= (10, 10))
for i in range (0,12):
# required nrows=4, required ncoms=4, index_location= i+1
ax = fig.add_subplot(4, 4, i+1)
# x_batch[i]: Image object at each iteration
ax.imshow(x_batch[i])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment