PlotWidget.plot() as ScatterPlotItem (x/y data points) plots but get "TypeError: arguments did not match any overloaded call:"

218 views
Skip to first unread message

Hey Jose

unread,
Feb 26, 2018, 4:25:32 PM2/26/18
to pyqtgraph
Greetings, 

I can post as much code as needed but to be brief:

        self.Plotty = QtWidgets.QWidget()
       
self.ui2 = Ui_Plotty()
       
self.ui2.setupUi(self.Plotty)  -->[ In setupUi, there is:  self.graphicsView = PlotWidget(Plotty) ]

       
self.Plotty.show()
       
       
self.trace1 = self.ui2.graphicsView.plot()
       
self.trace2 = self.ui2.graphicsView.plot()

Then somewhere else in the code I try:

self.trace1.setData(plotData_np_array[1::2], plotData_np_array[0::2],  pen=None, symbol='o')

and I get:

[14:11:27]  Ignored exception:
    |==============================>>
    |  Traceback (most recent call last):
    |    File ".\main.py", line 105, in <module>
    |      sys.exit(app.exec_())
    |    File "C:\ProgramData\Anaconda2\lib\site-packages\pyqtgraph\widgets\GraphicsView.py", line 154, in paintEvent
    |      return QtGui.QGraphicsView.paintEvent(self, ev)
    |    File "C:\ProgramData\Anaconda2\lib\site-packages\pyqtgraph\debug.py", line 93, in w
    |      printExc('Ignored exception:')
    |    --- exception caught here ---
    |    File "C:\ProgramData\Anaconda2\lib\site-packages\pyqtgraph\debug.py", line 91, in w
    |      func(*args, **kwds)
    |    File "C:\ProgramData\Anaconda2\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py", line 771, in paint
    |      list(imap(p.drawPixmap, data['targetRect'], repeat(atlas), data['sourceRect']))
    |  TypeError: arguments did not match any overloaded call:
    |    drawPixmap(self, QRectF, QPixmap, QRectF): argument 3 has unexpected type 'NoneType'
    |    drawPixmap(self, QRect, QPixmap, QRect): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, Union[QPointF, QPoint], QPixmap): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, QPoint, QPixmap): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, QRect, QPixmap): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, int, int, QPixmap): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, int, int, int, int, QPixmap): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, int, int, int, int, QPixmap, int, int, int, int): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, int, int, QPixmap, int, int, int, int): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, Union[QPointF, QPoint], QPixmap, QRectF): argument 1 has unexpected type 'QRectF'
    |    drawPixmap(self, QPoint, QPixmap, QRect): argument 1 has unexpected type 'QRectF'
    |==============================<<

When I don't add the other parameters: 

self.trace1.setData(plotData_np_array[1::2], plotData_np_array[0::2])

It plots/displays with no errors, but I get lines connecting the points, which I'm trying to avoid. 

Use case: The User can plot "curve" data or "scatter" data on the same plot window, depending on what different user selections. At least that's the idea.

Thank you,

-Hey José

P.S. I didn't see a place to add tags to this forum post, did I miss that somewhere? Tags: pyqtgraph, scatter, scatterplot, scatterplotitem, typeerror, plotwidget, overloaded, call

Hey Jose

unread,
Feb 26, 2018, 6:27:26 PM2/26/18
to pyqtgraph
Reply all
Reply to author
Forward
0 new messages