title: Embeding plot into graphicsView in PyQt5
body: <p>I use <code>pyqtgraph</code> to plot in PyQt5 GUI. I can plot in a pop-up window, but I am trying embed the graph in the <code>graphicsView</code> area.</p>
  
  <p>Here is how I can do a simple plot in a new window:</p>
  
  <pre><code>    self.pushButton.clicked.connect(self.btn_clk)
  
      MainWindow.show()
  def btn_clk(self):
      L = [1,2,3,4,5]
      pg.plot(L)
  </code></pre>
  
  <p>I tried to use this line to embed the plot, but it doesn't work:</p>
  
  <pre><code>    self.pushButton.clicked.connect(self.btn_clk)
  
      MainWindow.show()
  def btn_clk(self):
      L = [1,2,3,4,5]
      self.graphicsView.plot(L)
  </code></pre>
  
  <p>Here is the full code:</p>
  
  <pre><code>import pyqtgraph as pg
  from PyQt5 import QtCore, QtGui, QtWidgets
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(662, 512)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
          self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
          self.horizontalLayout.setObjectName("horizontalLayout")
          self.verticalLayout = QtWidgets.QVBoxLayout()
          self.verticalLayout.setObjectName("verticalLayout")
          self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit.setObjectName("lineEdit")
          self.verticalLayout.addWidget(self.lineEdit)
          self.graphicsView = QtWidgets.QGraphicsView(self.centralwidget)
          self.graphicsView.setObjectName("graphicsView")
          self.verticalLayout.addWidget(self.graphicsView)
          self.pushButton = QtWidgets.QPushButton(self.centralwidget)
          self.pushButton.setObjectName("pushButton")
          self.verticalLayout.addWidget(self.pushButton)
          self.horizontalLayout.addLayout(self.verticalLayout)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 662, 21))
          self.menubar.setObjectName("menubar")
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
          self.pushButton.setText(_translate("MainWindow", "PushButton"))
  
          self.pushButton.clicked.connect(self.btn_clk)
  
          MainWindow.show()
      def btn_clk(self):
          L = [1,2,3,4,5]
          pg.plot(L)#this line plots in a new window
          self.graphicsView.plot(L)#this line doesn't work
  
  
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_()) 
  </code></pre>