Same graph, different views

27 views
Skip to first unread message

Israel Brewster

unread,
Jul 9, 2019, 1:58:06 PM7/9/19
to pyqtgraph
Is it possible to have two views of the same graph? For example, showing a smaller zoomed out view, or a larger zoomed in view. I tried creating another PlotWidget (which for now is just shown as a separate window), and then calling setScene on it to set the scene to the existing scene, but with that it always shows exactly the same content as the main window - even cutting off the content when the second window is larger than the main one. Is there a way I can get to separate, independent, views of the same graph?

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

WILMER CONTRERAS SEPULVEDA

unread,
Jul 9, 2019, 2:32:57 PM7/9/19
to pyqt...@googlegroups.com
I saw an example where they was taking serial data and plot in two different graphs with different windows, so yes it is posible

--
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 pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/BA6D7812-700B-4B9A-BEB5-1D8348DCA3DE%40alaska.edu.
For more options, visit https://groups.google.com/d/optout.


--
Wilmer Contreras Sepulveda
Grupo de Investigación en Desarrollo de Microelectronica Aplicada
Universidad Francisco de Paula Santander

Israel Brewster

unread,
Jul 9, 2019, 2:41:00 PM7/9/19
to pyqtgraph
Ok, let me rephrase my question then. HOW can I get the same (complex, multi-plot) graph in two different windows with different zoom levels/sizes? My attempts so far have only resulted in a second window showing the exact same content as the first window - even when I resize the second window, it shows the same content at the same size, simply cutting off the content at whatever size the first window is.

If it helps, here is the incorrectly functioning code I used that gave me this second window:

        self.second_view = pg.PlotWidget()
        self.second_view.setScene(self._ui.PlotWidget.scene())
        self.second_view.show()

Where self._ui.PlotWidget is the initial instance of a pg.PlotWidget (I should change the name, but whatever).

I suppose an alternate option is to simply make two completely separate graphs, and graph the same thing in both, but I’m afraid this will kill performance and memory usage, as my plots are quite large and complicated.

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Reply all
Reply to author
Forward
0 new messages