刚刚接触Python,学习基本操作,并做下笔记。直接贴代码:

import matplotlib.pyplot as plt
from matplotlib.image import imread

img1 = imread('XY.jpg')
img2 = imread('../AIProgram/JQ.jpg')

plt.figure()
plt.subplot(1,2,1)
plt.imshow(img1)
plt.subplot(1,2,2)
plt.imshow(img2)

plt.show()

效果:

Matplotlib绘图——同时显示两幅图片

使用过MATLAB的童鞋看到方法后,是不是突然觉得似曾相识,

相关文章: