【发布时间】:2019-08-26 22:40:27
【问题描述】:
我有一个来自 sci-kit learn 的数据集,fetch_lfw_people。
import matplotlib.pyplot as plt
# plotting faces
fig, ax = plt.subplots(3,5)
# fig.subplots_adjust(wspace=2)
for enumerate_counter, axi in enumerate(ax.flat):
axi.imshow(faces.images[enumerate_counter], cmap='bone')
axi.set(xticks=[], yticks=[],xlabel=faces.target_names[faces.target[enumerate_counter]])
在尝试使用子图显示图像并使用正确名称标记每个图像时,我想增加每个图像的大小并将它们分开足够宽以使名称不会重叠。
我试过了
fig.subplots_adjust(wspace=2)
但是,这会将图像分开,因此名称不会重叠,但是图像会变小。
我能解决这个问题吗?
【问题讨论】:
标签: python matplotlib scikit-learn