How to update x_range y_range in callback?

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?

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 <[email protected]> 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 [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/e2e6c8d7-6baa-45bc-b492-4c155cb75769%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.