How to delete a single or multiple curves using mouse options

26 views
Skip to first unread message

Syed Fahad Iqbal

unread,
Nov 5, 2020, 6:46:41 PM11/5/20
to pyqtgraph
Hello All,

Following is the piece of code that I'm using to plot multiple curves but how can I define a function to enable mouse clicks to delete any specific curve by mouse click to select any specific curve and delete it using keyboard 'del' button.

def plot_lib(self, X, Y, style_=QtCore.Qt.SolidLine):
       #self.graphWidget.plotItem.clear()
        for i in range(len(X)):
              self.graphWidget.plot(X[i], Y[i], name=str(i),pen=pg.mkPen(width=2,  color=np.random.randint(0, 255, 3), style=style_))
 
Reply all
Reply to author
Forward
0 new messages