Bokeh server change axis-range

Hi,

I’m trying to plot live-data coming in from sensors, but I want to make the x-axis move as new data comes in, to only visualise the last 200 (more or less) points.

I found some ways using ‘cursession()’, but that feature seems depreciated in 0.12.1? Is there any way to make the plot auto-pan?

I included my current code.

Thanks!

PlotData.py (842 Bytes)

Hi,

A few notes:

The cursession() function as been deprecated since 0.10 IIRC, it was a function of the original Bokeh server, which has been completely removed.

For a current "automatically following" range example, refer to the OHLC app:
  
  https://github.com/bokeh/bokeh/tree/master/examples/app/ohlc

But I must also mention a serious problem with your code: You are trying to update a Bokeh model object (p.x_range) from outside the main thread. This is NEVER a safe operation. If you want to update things from other threads, you must use the technique described in the user's guide:

  http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-threads

Thanks,

Bryan

···

On Aug 4, 2016, at 7:56 AM, Wout Van Medegael <[email protected]> wrote:

Hi,

I'm trying to plot live-data coming in from sensors, but I want to make the x-axis move as new data comes in, to only visualise the last 200 (more or less) points.
I found some ways using 'cursession()', but that feature seems depreciated in 0.12.1? Is there any way to make the plot auto-pan?
I included my current code.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/120c6e93-905a-4b70-9ce0-1ad40068da39%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<PlotData.py>

OHLC is of great help, thanks!!

···

On 04 Aug 2016, at 15:25, Bryan Van de Ven <[email protected]> wrote:

Hi,

A few notes:

The cursession() function as been deprecated since 0.10 IIRC, it was a function of the original Bokeh server, which has been completely removed.

For a current "automatically following" range example, refer to the OHLC app:
  
  https://github.com/bokeh/bokeh/tree/master/examples/app/ohlc

But I must also mention a serious problem with your code: You are trying to update a Bokeh model object (p.x_range) from outside the main thread. This is NEVER a safe operation. If you want to update things from other threads, you must use the technique described in the user's guide:

  http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#updating-from-threads

Thanks,

Bryan

On Aug 4, 2016, at 7:56 AM, Wout Van Medegael <[email protected]> wrote:

Hi,

I'm trying to plot live-data coming in from sensors, but I want to make the x-axis move as new data comes in, to only visualise the last 200 (more or less) points.
I found some ways using 'cursession()', but that feature seems depreciated in 0.12.1? Is there any way to make the plot auto-pan?
I included my current code.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/120c6e93-905a-4b70-9ce0-1ad40068da39%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<PlotData.py>

--
You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/fuYZQVy6OYA/unsubscribe\.
To unsubscribe from this group and all its topics, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/9E8D5193-BFBF-41F0-A6A2-10A8299AD463%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.