문제

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 ?

도움이 되었습니까?

해결책

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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top