plt.plot(jd1,spd1)
plt.plot(jd1,spd1,marker="o",markerfacecolor="r",linestyle='None')
plt.show()
print 'click on any obviously bad points and then press the enter key.'
badpoints=ginput(n=0)
index_badpoints=[]
badpoints_num=len(badpoints)
for i in range(len(badpoints)):
index_badpoints.append(int(np.interp(badpoints[i][0],
yeardays,
range(len(yeardays)))))
print index_badpoints #always[107,107,107...]
问题是无论我点击哪一个点,我只能得到指数是107的点。 有人能帮我解决这个问题吗?你知道吗
我无法测试您的版本,但我可以向您展示如何解决此问题:
这将计算沿x轴从yeardays到badpoints的距离,并返回最近的索引。你知道吗
相关问题 更多 >
编程相关推荐