Issue
If I execute the following command:
for file in files:
display(Image(filename=os.path.join(folder,file)))
I get a list of images in a column:
How to put them in a row (horizontally)?
Solution
This worked for me:
from matplotlib.pyplot import figure, imshow, axis
from matplotlib.image import imread
def showImagesHorizontally(list_of_files):
fig = figure()
number_of_files = len(list_of_files)
for i in range(number_of_files):
a=fig.add_subplot(1,number_of_files,i+1)
image = imread(list_of_files[i])
imshow(image,cmap='Greys_r')
axis('off')
Answered By - BarzinM
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.