1

I have this code:

plot = pg.PlotItem()
plot.plot([1,2,3,4], [3,4,5,6], symbol='o')
viewer = pg.ImageView(view=plot)
self.tabLOs["Server"].addWidget(viewer)

to do a quick proof-of-concept for making a few simple graphs to display system data. I want a very simple graph that I can update as the data comes in. The code above gives me a graph but with an interactive area to the right. I've found other classes that give me just graphs, but they aren't able to be used with addWidget and/or have the plot() method. Is there a PlotItem equivalent that doesn't have all the extra stuff that I can just add to an existing layout with addWidget?

EDIT: pg is from "import pyqtgraph as pg" and tabLOs["Server"] is just a VBox layout.

1 Answer 1

1

I think you want to create a pg.PlotWidget which can be added to your QVBoxLayout. You can then get the plot item using my_plot_widget.getPlotItem() (this method negates the need to create your own PlotItem).

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect. Worked like a charm. For future readers, I switched to this: plot = pg.PlotWidget() pi = plot.getPlotItem() pi.plot([1,2,3,4], [3,4,5,6], symbol='o') self.tabLOs["Server"].addWidget(plot)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.