Mar*_*ury 2 python plot matplotlib computer-vision
我想使用 matplotlib 在 Python 中并排绘制两个图像。但是我不想创建单独的子图。我想在同一个图中绘制两个图像,以便我可以绘制两个图像之间的对应关系。见下图。
在 Matlab 中,我相信这可以使用 imshow([I1, I2]) 来完成,但是 matplotlib 的 python API 不接受图像数组。有没有办法在python中做到这一点?
如果您使用 numpy,您可以使用 numpy concatenate 函数简单地制作一个代表两个图像的大数组:
import numpy as np
import matplotlib.pyplot as plt
img_A = np.ones((10,10))
img_B = np.ones((10,10))
plot_image = np.concatenate((img_A, img_B), axis=1)
plt.imshow(plot_image)
plt.show()
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9808 次 |
最近记录: |