A bug in ScatterPlotItem

29 views
Skip to first unread message

Jeremy Webster

unread,
Sep 5, 2018, 6:39:25 PM9/5/18
to pyqtgraph
I believe I posted this either here or in the issues section on github at one time, but I never heard anything so I'm trying again

i have a PlotDataItem and I'm trying to connect the sigPointsClicked signal to a function. 

The problem is that when I click on a point, I get the following TypeError...

    |    File "/home/jwebster/anaconda3/envs/py3/lib/python3.6/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 817, in pointsAt
    |      s2x = s2y = ss * 0.5
    |  TypeError: can't multiply sequence by non-int of type 'float'


I don't know that this will get fixed anytime soon, and I really need this to work

Can someone suggest a workaround?


this is how I create the curve and connect it.

self.b_curve = pg.PlotDataItem(x=self.t,
                                            y
=self.b,
                                            pen
=None,
                                            brush
=bcolor,
                                            symbol
=symb,
                                            symbolPen
=bcolor,
                                            symbolBrush
=bcolor,
                                            symbolSize
='5')

self.b_curve.sigPointsClicked.connect(self.pointsClicked)


def pointsClicked(self, points):
   
for idx, point in enumerate(points):
       
print('{}: x={}, y={}'.format(idx, point.x(), point.y()))



Reply all
Reply to author
Forward
0 new messages