I'm running into an issue where when I remove the the scatterPlotItem from
GLViewWidget, it removes the grids from the view as well.
My code right now is way too long to post all of it but basically:
plotWidget = gl.GLViewWidget()
xgrid = gl.GLGridItem()
ygrid = gl.GLGridItem()
zgrid = gl.GLGridItem()
plotWidget.addItem(xgrid)
plotWidget.addItem(ygrid)
plotWidget.addItem(zgrid)
... create multiple glScatterPlotItems
with different pos, size, and color
plotList = [glScatterPlotItem1, glScatterPlotItem2,...]
...depending on user input in MainWindow
for i in range(0, len(plotList)):
# This part is to remove all ScatterPlotItems from the
# widget so only the selected item will be visible.
# Because code does not know which one is added and which one is not.
# If there is a better way, please let me know
try:
print "removed: ", i, plotList[i] # to make sure I'm only removing
scatter plots
plotWidget.removeItem(plotList[i])
except ValueError:
pass
if i == userInput: # only add the one that user selected
plotWidget.addItem(plotList[i])
--
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/e9bd0e3a-ad29-4076-9095-0c4f5c4dcfe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.