Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 Python Matplotlib图contourf或imshow上的散点图_Python 2.7_Matplotlib - Fatal编程技术网

Python 2.7 Python Matplotlib图contourf或imshow上的散点图

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

以下问题: 我有表面数据,我可以绘制为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=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范围的限制设置错误了……非常感谢!