☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to update x_range y_range in callback?

Community Support
John_Liu
John_Liu

Hi,

I’m using Bokeh server with callbacks to modify the plotted data using {renderer.data_source.data=new_data}. I want to customize the plot range at the same time. I’ve tried using {p.x_range.update(start=some_value)} after updating the data but it seems to be racing against auto-range adjustment. After interacting and updating the data sometimes the range is set the way I want, sometimes it is auto set, sometimes one side is set the way I want while other sides are autoset.

Is there a right way to do this?

⌁   Link to post
Bryan
Bryan

Plots created using bokeh.plotting add auto-ranging DataRange1d ranges by default. If you don't want auto ranging, you should create the plot with explicit bounds, e.g:

  plot = figure(x_range=(0,10), y_range=(20, 30)

Thanks,

Bryan

···

On Sep 21, 2016, at 9:44 AM, John Liu <jsqliu@gmail.com> wrote:

Hi,

I'm using Bokeh server with callbacks to modify the plotted data using {renderer.data_source.data=new_data}. I want to customize the plot range at the same time. I've tried using {p.x_range.update(start=some_value)} after updating the data but it seems to be racing against auto-range adjustment. After interacting and updating the data sometimes the range is set the way I want, sometimes it is auto set, sometimes one side is set the way I want while other sides are autoset.

Is there a right way to do this?

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e2e6c8d7-6baa-45bc-b492-4c155cb75769%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled