【发布时间】:2019-05-09 02:35:16
【问题描述】:
想要在灰度图像中绘制一个数组。这是我的数组:
[[[ 0.27543858 0.30173767 -0.0101363 0.30631673 0.08575112
0.02205707 -0.15502007 0.11055402 -0.11761152]
[ 0.23695524 0.19820367 -0.08758862 0.02446048 0.29235974
-0.11381532 -0.00426369 0.15231356 -0.24601455]]]
它的维度是 (1, 2, 9)。它应该产生两个图像,每个图像有 9 个值。 到目前为止我已经尝试过了:
col_size = 1
row_size = 2
index = 0
fig, ax = plt.subplots(row_size, col_size, figsize=(12,8))
for row in range(0,row_size):
for col in range(0,col_size):
ax[row][col].imshow(result_array[:,:,index],cmap='gray')
index += 1
plt.show()
【问题讨论】:
标签: python-2.7 matplotlib