heyho
situation
i have multiple scatterplots in a viewbox in pyqtgraph. since i want to 'cut something out' of it, i create a PolyLineROI somewhere in the plot with initial three handles. when i start dragging the whole thing to its destination (and append maybe append another handle) the positions of the handles still have their original position from where it started. even when i drag the handles themselves they change their values relativ to their starting position... which results in the wrong selected area.
MWE
import pyqtgraph as pg
def roiMove():
"""Print the coordinates of the ROI."""
print(roi.getState()['points'])
win = pg.GraphicsWindow()
vb = win.addViewBox()
# roi in rectangle shape
roi = pg.PolyLineROI([[1, 2], [1.5, 2], [1, 0]],
closed=True,
pen=pg.mkPen(color=(0, 201, 255, 255), width=3)
)
# connect to printing function when moving something
# NOTE: when dragging the whole ROI the positions won't be updated
roi.sigRegionChanged.connect(roiMove)
vb.addItem(roi)
pg.QtGui.QApplication.exec_()
it would be awesome if someone had an idea :-)
cheers