I did this part promoting “PlotWidget” :
1. In Designer, create a QGraphicsView widget (“Graphics View” under the
“Display Widgets” category).
2. Right-click on the QGraphicsView and select “Promote To...”.
3. Under “Promoted class name”, enter the class name you wish to use
(“PlotWidget”, “GraphicsLayoutWidget”, etc).
4. Under “Header file”, enter “pyqtgraph”.
5. Click “Add”, then click “Promote”.
Now, I am trying to plot in the GraphicsView.
self.pushButton.clicked.connect(self.btn_clk)
MainWindow.show()
def btn_clk(self):
L = [1,2,3,4,5]
pg.plot(L)
If I use this above, the plot shows up in a new window.
My question is: how can I plot in the GraphicsView instead of a new window.
I tried several different variations of getPlotItem(), but it didn't work.
Thanks very much.
Cheers,
Joe
--
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/4f0758c2-bfa8-4018-812b-0346d19db811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.