from keras.datasets import fashion_mnist
import matplotlib.pyplot as plt
(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
#读取10张fashion_mnist中的图片
#subplot(nrow,ncol,index)其中nrow为行数,ncol为列数,index为索引(从1开始)
for i in range(10):
plt.subplot(2,5,i+1)
plt.imshow(x_train[i])
plt.axis('off')#隐藏坐标轴
plt.show()
matplotlib显示多张图片
最新推荐文章于 2023-06-10 15:49:28 发布