Hello,

I am trying to make an app to plot the signals received from a 
microcontroller. The main point is to be able to plot the signal from the 
different channels. I created different checkboxes in order to be able to 
choose from which channel I want to plot the data. 

I have this code for one checkbox and it works:

def plot_channels(self,ch): 
        self.view = pg.GraphicsView()
        self.view.show()
        
        if ch.text() == "Channel 0":
            if ch.isChecked() == True:
                self.dataPlot_0 = np.sin(np.linspace(0, 5 *np.pi , 2000))
        
                self.graph_0 = pg.PlotItem()
                self.graph_0.plot(self.dataPlot_0)

                self.lay = pg.GraphicsLayout()                    
                self.lay.addItem(self.graph_0)

                self.view.setCentralItem(self.lay)
                #self.view.showMaximized()


However, when I create a second checkbox related to another channel and 
also check it another window appears with the second signal and replace the 
first one.

I want to have only one window when the different plots appear as soon I 
check the respective checkbox.

Can someone help me to figure it out?

Thank you for the time and help.

Regards,

RR

-- 
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/9f65abfc-fb65-452a-b2bd-48ad068e5d7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to