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
--
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/b97037a2-aa00-482a-8a2e-202346ff0837%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.