我正在尝试识别和计算用户定义的“楔形”选择范围内的数据点。每个数据点都有自己的ID号,并从CSV目录文件加载,而“楔形”只是在绘图上绘制的一系列线。在
下面是一个绘图示例:
import matplotlib.pyplot as plt
x = ID['x']
y = ID['y']
plt.figure()
plt.scatter(x, y)
plt.plot([-1, -1, 2, 2, ], [4, 1, -2, 4], color='r', linewidth=1, linestyle='--')
plt.xlim(-4,4)
plt.ylim(-4,4)
plt.show()
示例图:http://i.imgur.com/UENwbks.png
我要找两个输出
1)“楔子”内所有ID(数据点)的列表
2)所有ID(数据点)的计数,一旦完成上述任务,这是一项相当简单的任务!在
我最初的想法是:
^{pr2}$在哪里???是楔形物上方的面积(也许是线性方程?)。在
如有任何帮助,我们将不胜感激。在
您可以定义路径并使用其contains_points方法:
相关问题 更多 >
编程相关推荐