H=[[0,0,0,0][0,1,2,3][0,3,4,3][0,5,2,3]]
是否有任何方法将H[i在范围(1,4)][j在范围(1,4)]与范围(1,4)中的x轴和范围(1,4)中的y轴绘制出来?
我想去掉图中最暗的部分
我试过了
import numpy as np
import matplotlib.pyplot as plt
H=[[0,0,0,0][0,1,2,3][0,3,4,3][0,5,2,3]]
V=np.array([[H[i][j] for j in range(1,4)] for i in range(1,4)])
plt.imshow(V)
plt.colorbar(orientation='vertical')
plt.show()
但该图显示H[1][1]在(x,y)=(0,0)上。我想让它显示(i,j)上的每个H[i][j]。我已经找了很长时间,但我找不到解决办法。请帮帮忙
1条答案
按热度按时间kadbb4591#
IIUC,您可以将0替换为
np.nan
:输出: