Hi Guys,
I am really novice to python. Basically i am trying to write my own python program for my own graduate research.
i had used python and matplotlib before but is troubled by the plotting and i have been learning about pyqtgraph in my current project.
It's really great!!
However i'm running into trouble trying to put the same crosshair in the example to show real time x and y information depending on the mouse position.
But I don't really understand the mapSceneToView and the evt.

It look like this. I am calling a control gui i generated by qtdesigner.
in the __init__ of the QMainWindow i try to generate the pyqtgraph window
self.win=pg.GraphicsWindow()
self.win.setWindowTitle('live plot from serial')
self.p = self.win.addPlot()
self.p.addLegend()
self.p.setTitle('Python-Arduino Temp Controller')
self.p.setLabel('bottom', text='Time', units='s')
self.p.setLabel('left', text='Temp', units='oC')
self.label=pg.LabelItem(justify='right')
self.win.addItem(self.label)
#self.label.setText("<span style='font-size:12pt'>test")
self.curve_max = self.p.plot(pen='r', name='MAX31855')
#adding of crosshair from pyqtgraph examples
self.vLine = pg.InfiniteLine(angle=90, movable=False)
self.hLine = pg.InfiniteLine(angle=0, movable=False)
self.p.addItem(self.vLine, ignoreBounds=True)
self.p.addItem(self.hLine, ignoreBounds=True)
self.vb=self.p.vb
self.p.scene().sigMouseMoved.connect(self.mouseMoved)
And the last code can link the movemenet into a def mouseMoved(self, evt) in the same class.
But i am really stuck as to how to get the position of the mouse and then set the position of the crosshair to the mouse position.
I don't really understand the evt.
if i start with pos=evt[0] as in the example.
it returns QPointF object does not supper indexing
I also tried directly looking for the mousepoint by
mousePoint = self.p.vb.mapSceneToView(self.win)
I do have to admit that i read i should point to a viewbox but i don't know what that will be in my system .
Sorry I am really not good at this.
Any help is greatly appreciated.
best,
Paul