If I have multiple images (loaded as NumPy arrays) how can I display the in one IPython Notebook cell?
I know that I can use plt.imshow(ima)
to display
from matplotlib.pyplot import figure, imshow, axis
from matplotlib.image import imread
mypath='.'
hSize = 5
wSize = 5
col = 4
def showImagesMatrix(list_of_files, col=10):
fig = figure( figsize=(wSize, hSize))
number_of_files = len(list_of_files)
row = number_of_files/col
if (number_of_files%col != 0):
row += 1
for i in range(number_of_files):
a=fig.add_subplot(row,col,i+1)
image = imread(mypath+'/'+list_of_files[i])
imshow(image,cmap='Greys_r')
axis('off')
showImagesMatrix(listOfImages,col)
based on @Michael answer