Last active
June 8, 2022 08:45
-
-
Save konverner/0f07fe62e03835bac547e4d6ffc58602 to your computer and use it in GitHub Desktop.
display a grid of images in matplotlib.pyplot
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
def show_img_grid(images, labels, N): | |
n = int(N**(0.5)) | |
k = 0 | |
f, axarr = plt.subplots(n,n,figsize=(10,10)) | |
for i in range(n): | |
for j in range(n): | |
axarr[i,j].set_title(labels[k]) | |
axarr[i,j].imshow(images[k]) | |
k += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment