Discussion:
[pyqtgraph] Auto-pan speed
Alex Schueth
2016-05-17 17:15:17 UTC
Permalink
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?
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.
- 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
--
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/3b227d2c-098d-4447-ab6b-55757f09671e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
c***@gmail.com
2018-10-02 07:43:29 UTC
Permalink
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
Post by Alex Schueth
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?
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.
- 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
--
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/5050facf-9563-4bbc-b927-536d641e887b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Carlos Pascual
2018-10-02 12:22:25 UTC
Permalink
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
Post by c***@gmail.com
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?
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
Post by Alex Schueth
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?
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.
- 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: ***@cells.es
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 pyqtgraph+***@googlegroups.com.
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.
c***@gmail.com
2018-10-03 04:13:56 UTC
Permalink
Hi Carlos,
Thank you so much for your post. I tried the demo without the taurus, I
replaced PyQt4 with pyqtgraph, and it works great.
I am still studying your demo code to see if I can use it as a base class
to create the effect as in the demo:
https://peque.github.io/EuroPython-Bilbao-2016/video/gui_chart.webm , as I
notice your demo pans the x-axis after a certain period of time.
Could you advise me how to pan the chart with every new update point, as
opposed to by time? That is, with a new point, it pans right. My use case
is to chart forex market data as it streams in.

Thank you so much,
Cloud Ostrich
Post by Carlos Pascual
I created something similar for my my taurus_pyqtgraph project
(https://github.com/taurus-org/taurus_pyqtgraph)
https://gist.github.com/cpascual/ce1cfc30c9d4596bfaa41d16a9ca5d6a
Post by c***@gmail.com
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?
Post by c***@gmail.com
https://peque.github.io/EuroPython-Bilbao-2016/video/gui_chart.webm
,(from
Post by c***@gmail.com
the 00:15 mark to the end), where one can still interactively explore
the
Post by c***@gmail.com
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
Post by c***@gmail.com
me on this, as I am somewhat new to pyqtgraph.
Thanks in advance
Post by Alex Schueth
Sorry to revive this 3 years later, but did you ever find a solution
that
Post by c***@gmail.com
Post by Alex Schueth
would pan to the latest data point but would still allow
interactivity?
Post by c***@gmail.com
Post by Alex Schueth
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.
- The easiest solution is just to call self.plot1.setXRange()
manually
Post by c***@gmail.com
Post by Alex Schueth
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
Post by c***@gmail.com
Post by Alex Schueth
"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.
Post by c***@gmail.com
Post by Alex Schueth
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
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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/50b74886-7bcd-4254-adbd-629fb73a1020%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Carlos Pascual
2018-10-03 07:25:08 UTC
Permalink
Post by c***@gmail.com
Could you advise me how to pan the chart with every new update point, as
opposed to by time? That is, with a new point, it pans right.
In my case i used a time trigger for 2 reasons:
- efficiency (in my apps it is common to get thousands of new points per second)
- isolation: i wanted to implement it as a tool that does not require any extra config to be usable other than to attach it to an existing plot.

But if you do not have those constraints, just call the updateRange method whenever you are processing a new incoming event.

I hope this helps
--
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/26C3516C-6F63-4C80-9413-89CA0681E371%40cells.es.
For more options, visit https://groups.google.com/d/optout.
c***@gmail.com
2018-10-05 05:59:32 UTC
Permalink
Dear Carlos,
Sorry for late reply. I added a line "autopan.updateRange()" in the
addPoint function, and deleted all timer lines in the XAutoPanTool class.
It worked fantastic. Thank you so much for your help. It was invaluable, as
I am still a noob. Don't know how to thank you enough... was stuck in this
problem for about 2 weeks now. Would like to buy you a beer if there is a
chance. :)
Post by Carlos Pascual
Post by c***@gmail.com
Could you advise me how to pan the chart with every new update point, as
opposed to by time? That is, with a new point, it pans right.
- efficiency (in my apps it is common to get thousands of new points per second)
- isolation: i wanted to implement it as a tool that does not require any
extra config to be usable other than to attach it to an existing plot.
But if you do not have those constraints, just call the updateRange method
whenever you are processing a new incoming event.
I hope this helps
--
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/019afd6f-e3ac-4337-ae96-74c14e8e577d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Carlos Pascual
2018-10-05 13:37:51 UTC
Permalink
No worries,
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: ***@cells.es
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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/1815727.5MN8nIgPyD%40pc218.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...