Python 2.7 Python Matplotlib图contourf或imshow上的散点图
以下问题: 我有表面数据,我可以绘制为imshow或contourf,我的下一步是绘制np.mesgrid数组中给定的某些点,作为contourf上的散点图。我的代码没有失败,但没有显示轮廓上的散点图Python 2.7 Python Matplotlib图contourf或imshow上的散点图,python-2.7,matplotlib,Python 2.7,Matplotlib,以下问题: 我有表面数据,我可以绘制为imshow或contourf,我的下一步是绘制np.mesgrid数组中给定的某些点,作为contourf上的散点图。我的代码没有失败,但没有显示轮廓上的散点图 fig1=plt.figure() #plate=plt.imshow(twi, vmin=-1, vmax=2, origin='lower',extent=[x.min(), x.max(), y.min(), y.max()], interpolation='bilinear') plate
fig1=plt.figure()
#plate=plt.imshow(twi, vmin=-1, vmax=2, origin='lower',extent=[x.min(), x.max(), y.min(), y.max()], interpolation='bilinear')
plate=plt.contourf(xi,yi,twi,21,vmin=-1, vmax=2)
plt.colorbar()
plt.scatter(xx_sensor,yy_sensor,marker='o', c='b', s=5, zorder=10,lw=100)
plt.xlim(x.min(), x.max())
plt.ylim(y.min(), y.max())
plt.show()
你有没有检查过,散射点是否在xlim和ylim边界指定的视点范围内?这应该很容易,因为imshow在这里工作:。哦,太愚蠢了,你是对的,x和y范围的限制设置错误了……非常感谢!