Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding PyQtGraph in Qt without generating new Window

I do not get how to embed PyQtGraph in my MainWindow without generating a new window like it is done by using

pg.plot(...)

What is the easiest way for doing that ?

like image 854
dan_0 Avatar asked Jul 29 '13 13:07

dan_0


1 Answers

Pyqtgraph provides a long list of widgets which can be embedded. The documentation for pg.plot() states that this function creates and displays a PlotWidget, so that's probably the one you want.

Example:

my_plot = pg.PlotWidget()
my_layout.addWidget(my_plot)
my_plot.plot(x, y)
like image 126
Luke Avatar answered Sep 21 '22 20:09

Luke