我正在尝试从 jupyter notebook 中的文件绘制多个图像。图像已显示,但它们在一个列中。我在用着:
%matplotlib inline
from os import listdir
form PIL import image as PImage
from matplotlib import pyplot as plt
def loadImages(path):
imagesList = listdir(path)
loadedImages = []
for image in imagesList:
img = PImage.open(path+image)
LoadedImages.append(img)
Return loadedImages
path = 'C:/Users/Asus-PC/flowers/'
imgs = loadImages(path)
for img in imgs
plt.figure()
plt.imshow(img)
我希望它们出现在网格布局(行和列)中。部分问题是我不知道 add_subplot 的参数是什么意思。我怎样才能做到这一点?
慕工程0101907
开满天机
侃侃尔雅
随时随地看视频慕课网APP
相关分类