I created something similar for my my taurus_pyqtgraph project (https://github.com/taurus-org/taurus_pyqtgraph)
Here is a demo snippet which that can be tested without taurus: https://gist.github.com/cpascual/ce1cfc30c9d4596bfaa41d16a9ca5d6a On Tuesday, October 2, 2018 12:43:29 AM CEST [email protected] wrote: > Dear All, > > I have been scouring the stackoverflow and this forums for a solution to > the above original question, but have not found anything usable. Is it > possible to create a chart that auto-pans the x-axis to see the latest data? > I am trying to do something like the demo in this link: > https://peque.github.io/EuroPython-Bilbao-2016/video/gui_chart.webm ,(from > the 00:15 mark to the end), where one can still interactively explore the > data. I believe it is done similar to what Luke mentioned above (5years > ago), with a button to do a custom-type auto-pan to last input data on > right of x-axis. I am using the customGraphicsItem.py example from the > pyqtgraph github, as base.I would really appreciate if someone could help > me on this, as I am somewhat new to pyqtgraph. > Thanks in advance > > On Tuesday, May 17, 2016 at 5:15:18 PM UTC, Alex Schueth wrote: > > Sorry to revive this 3 years later, but did you ever find a solution that > > would pan to the latest data point but would still allow interactivity? > > > > On Tuesday, December 3, 2013 at 8:23:04 AM UTC-6, Largerhats wrote: > >> On Monday, 2 December 2013 17:21:36 UTC-5, Luke Campagnola wrote: > >>> Thank you, I understand now. > >>> The problem is that auto-pan is designed to center the view on the > >>> *average* value of an axis without changing the width of the view > >>> range. I can see how the terminology "auto pan" is confusing in this > >>> case. > >>> > >>> Possible solutions: > >>> - The easiest solution is just to call self.plot1.setXRange() manually > >>> after each update, but then you lose the ability to interactively > >>> explore > >>> the data. > >>> > >>> - This could be corrected by some mechanism allowing the user to > >>> enable/disable automatic panning (perhaps overriding the behavior of the > >>> "A" button in the PlotItem, or adding a new button there) > >>> > >>> - Possibly ViewBox could be given a new option specifying whether it > >>> should auto-pan to the (min, mean, median, max) > >>> > >>> > >>> Luke > >> > >> Luke, > >> > >> Thanks again for your help. This is exactly the clarification I needed. > >> > >> Cheers -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: [email protected] Phone: +34 93 592 4428 +----------------------------------------------------+ -- 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/3018294.T5SXuGmvua%40pc218. For more options, visit https://groups.google.com/d/optout.
