我正在尝试仅输出polyLineROI的坐标。句柄由用户添加。
def set_fan_curve(self):
values = []
p1 = pg.PolyLineROI([0,0], closed=False, invertible=False, removable=True)
testlist = p1.getLocalHandlePositions()
for i in enumerate(testlist):
values.append(i)
print(values)
这是带有2个句柄的枚举列表值的输出:
[(0, (None, Point(0.000000, 0.000000))), (1, (None, PyQt4.QtCore.QPointF(25.864716636197443, 36.0)))]
如何仅显示每个列表项的浮点值?如果有帮助,则int值是pyqtgraph中图的x和y坐标。 例如,我尝试获取的输出是:
[(0, (0.000000, 0.000000)), (1, (38.10603290676418, 48.92307692307692))]