File "C:\Python34\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlot
    self.buildAtlas()
  File "C:\Python34\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlot
    img = renderSymbol(key[0], key[1], sourceRect.pen, sourceRect.brush)
  File "C:\Python34\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlot
    drawSymbol(p, symbol, size, pen, brush)
  File "C:\Python34\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlot
    painter.setBrush(brush)
TypeError: arguments did not match any overloaded call:
  QPainter.setBrush(QBrush): argument 1 has unexpected type 'str'
  QPainter.setBrush(Qt.BrushStyle): argument 1 has unexpected type 'str'

On Sunday, October 19, 2014 at 7:58:01 PM UTC+5:30, Nicholas Tan Jerome 
wrote:
>
> No problem, if my fix is accepted, in future you don't need this hack to 
> make it work :)
>
> On Friday, 17 October 2014 17:22:41 UTC+2, Bobby Henley wrote:
>>
>> I don't fully understand why, but that did the trick! Thank you very much
>>
>> On Friday, October 17, 2014 5:09:26 AM UTC-4, Nicholas Tan Jerome wrote:
>>>
>>> Hi Bobby,
>>>
>>> I think you are right that setBrush should also accept list, not only 
>>> that, one can use mask to determine which to be filled.
>>>
>>> A hack to make this work is to pass the "mask" keyword
>>>
>>> do it like this 
>>>
>>> example.setBrush(['r']*numberofscatterpoints, mask=None) and this should 
>>> work.
>>>
>>> I feel like the keyword is not checked properly. If one can just check 
>>> the mask keyword before, then we will not need to always pass mask=None to 
>>> make this work.
>>>
>>> pull request: 
>>>
>>> https://github.com/pyqtgraph/pyqtgraph/commit/884df4934af6eadaa0065b700853838a32440576
>>>
>>> -N
>>>
>>>
>>> On Thursday, 16 October 2014 23:41:08 UTC+2, Bobby Henley wrote:
>>>>
>>>> I have a scatterplot containing a large amount of points, I would like 
>>>> to be able to change the colors of points on the fly, and change certain 
>>>> ones to different colors.
>>>> The documentation for setBrush indicates that it should be able to take 
>>>> a list of values and set the brush colors accordingly. So far this command 
>>>> only works for using a single brush value for all points on a scatterplot. 
>>>> When I try to input a list, say for example
>>>>
>>>> example=pg.ScatterPlotItem()
>>>> example.setBrush(['r']*numberofscatterpoints)
>>>>
>>>> will return the following error
>>>>
>>>>   File 
>>>> "E:\Robert\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
>>>>  
>>>> line 446, in setBrush
>>>>     if kargs['mask'] is not None:
>>>> KeyError: 'mask'
>>>>
>>>> but if I try to use only one input value, ie
>>>>
>>>> example=pg.ScatterPlotItem()
>>>> example.setBrush('r')
>>>>
>>>> I have no issues. Does setBrush not actually take lists? Or am I doing 
>>>> something wrong?
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/b1f4e2cb-d9b7-4be3-b2b2-1b2a71dbfa6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to