(self)
第一种绘图方式
第一种绘图方式
第一种绘图方式
def draw1(self):

        self.pyqtgraph1.clear()

        '''第一种绘图方式'''
        print(np.random.normal(size=120))
        self.pyqtgraph1.addPlot(title="绘图单条线", y=np.random.normal(size=120), pen=pg.mkPen(color='b', width=2))

        '''第二种绘图方式'''
        plt2 = self.pyqtgraph1.addPlot(title='绘制多条线')

        plt2.plot(np.random.normal(size=150), pen=pg.mkPen(color='r', width=2),
                  name="Red curve")
        plt2.plot(np.random.normal(size=110) + 5, pen=(0, 255, 0), name="Green curve")
        plt2.plot(np.random.normal(size=120) + 10, pen=(0, 0, 255), name="Blue curve")
def draw1 ( self ) : self . pyqtgraph1 . clear ( ) print ( np . random . normal ( size = 120 ) ) self . pyqtgraph1 . addPlot ( title = "绘图单条线", y=np.ran d m . no r mal(si z e=120) ,  pen = pg. m k en( c ol o r='b' ,  widt h =2) ) '''第二种绘图方式''' plt2 = self . pyqtgraph1 . addPlot ( title = '绘制多条线') plt2 . plot ( np . random . normal ( size = 150 ) , pen = pg . mkPen ( color = 'r' , width = 2 ) , name = "Red curve" ) plt2 . plot ( np . random . normal ( size = 110 ) + 5 , pen = ( 0 , 255 , 0 ) , name = "Green curve" ) plt2 . plot ( np . random . normal ( size = 120 ) + 10 , pen = ( 0 , 0 , 255 ) , name = "Blue curve" )