Hello dear, I hope I solved the problem.
What you say is that the cursor path is plotted? This is what I want to do.
I am using a code to get the coordinates of the cursor, but I can not return the values outside the function, since I want to save them in .csv
I hope someone can help me return the values outside the function.
Thank you very much for your attention.
Code is:
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
Point = []
def mouseMoved(evt):
global Point, cursor2
mousePoint = p.vb.mapSceneToView(evt[0])
Point.append([mousePoint.x(), mousePoint.y()])
#print Point
#print mousePoint.x(), mousePoint.y()
win = pg.GraphicsWindow()
win.resize(700, 600)
p = win.addPlot()
p.setMouseEnabled(x=False, y=False)
p.setXRange(-60, 60, padding=None)
p.setYRange(140, 250, padding=None)
p.showGrid(x=True, y=True, alpha=0.3)
proxy = pg.SignalProxy(p.scene().sigMouseMoved, rateLimit=60, slot=mouseMoved)
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
Best regards!!
Daniel Araya Rocha