hi :-)
i am trying to create my own symbol for a scatterplotitem but can't get it to work. i have tried a few ways described in the documentation and several (well.. there are not that many) examples in the web. from my understanding in the docu i can pass a created QPainterPath to the symbol argument of ScatterPlotItem.. like this:
class Symbols():
# something like a bowtie
valves = np.asarray([
[0.4330127, 0.25],
[0.4330127, -0.25],
[-0.4330127, 0.25],
[-0.4330127, -0.25],
[0.4330127, 0.25]
])
valve = pg.arrayToQPath(valves[:, 0], valves[:, 1], connect='all')
# >>> <class 'PyQt5.QtGui.QPainterPath'>
class Show()
# stuff here..
def _showMeSomething(self):
valve_symbols = ScatterPlotItem(
size=20,
pen=pg.mkPen(0, 0, 0, 255),
brush=pg.mkBrush(224, 76, 2, 255),
# symbol='t',
symbol=Symbols.valve
)
spots = ...
valve_symbols.addPoints(spots)
figure.add(valve_symbols)
at the point of addPoints i get the following error:
File "venv3/lib/python3.5/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 409, in addPoints
self.updateSpots(newData)
File "venv3/lib/python3.5/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 559, in updateSpots
sourceRect = self.fragmentAtlas.getSymbolCoords(opts)
File "venv3/lib/python3.5/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 134, in getSymbolCoords
sourceRect[i] = self.symbolMap[key]
File "venv3/lib/python3.5/weakref.py", line 131, in __getitem__
o = self.data[key]()
TypeError: unhashable type: 'QPainterPath'
could someone help me with that? o.O if a MWE should be necessary i think i can break that down :-)
cheers in advance
friedrich