好吧,您的问题假设了其他一些问题,但我认为您可能正在寻找pcolormesh。例如以这种方式使用(我将它放在一个网格中,就像您的示例图片一样,数据是随机生成的):
import matplotlib.pyplot as plt
import numpy as np
ax1 = plt.subplot2grid((4,4),(0, 0),rowspan=1,colspan=1)
ax2 = plt.subplot2grid((4,4),(1, 0),rowspan=1,colspan=1)
ax3 = plt.subplot2grid((4,4),(2, 0),rowspan=1,colspan=1)
ax4 = plt.subplot2grid((4,4),(3, 0),rowspan=1,colspan=1)
ax5 = plt.subplot2grid((4,4),(0, 1),rowspan=2,colspan=3)
ax6 = plt.subplot2grid((4,4),(2, 1),rowspan=2,colspan=3)
ax1.plot(range(100),np.random.randint(-100,100,100)/np.arange(1,101,1)**1,color='green')
ax1.axhline(10,color='orange',linestyle='--')
ax1.axhline(-10,color='orange',linestyle='--')
ax1.set_ylim(-20,20)
ax1.set_xticks([])
ax1.set_ylabel('D4',rotation=0)
ax2.plot(range(100),np.random.randint(-100,100,100)/np.arange(1,101,1)**1,color='green')
ax2.axhline(10,color='orange',linestyle='--')
ax2.axhline(-10,color='orange',linestyle='--')
ax2.set_ylim(-20,20)
ax2.set_xticks([])
ax2.set_ylabel('D3',rotation=0)
ax3.plot(range(100),np.random.randint(-100,100,100)/np.arange(1,101,1)**1,color='green')
ax3.axhline(10,color='orange',linestyle='--')
ax3.axhline(-10,color='orange',linestyle='--')
ax3.set_ylim(-20,20)
ax3.set_xticks([])
ax3.set_ylabel('D2',rotation=0)
ax4.plot(range(100),np.random.randint(-100,100,100)/np.arange(1,101,1)**1,color='green')
ax4.axhline(10,color='orange',linestyle='--')
ax4.axhline(-10,color='orange',linestyle='--')
ax4.set_ylim(-20,20)
#ax4.set_xticks([])
ax4.set_ylabel('D1',rotation=0)
X,Y = np.meshgrid(range(1000),range(4))
Z = np.random.randint(0,100,(4,1000))
ax5.pcolormesh(X,Y,Z,cmap = 'copper')
ax5.set_yticks([i for i in range(4)])
Zm = np.ma.masked_where(Z<90,Z)
ax6.pcolormesh(X,Y,Zm,cmap = 'copper')
ax6.set_yticks([i for i in range(4)])
plt.show()
结果是这样的: