Fixing y-axis range interval to a specific value

Hi,

I’m generating plots from a Bokeh server and I’m trying to keep the y-axis range interval fixed to a value, so that when multiple plots are displayed they have consistent scale.

Padding by percentage or absolute value using range_padding doesn’t quite do the job since the data range varies, and it doesn’t seem like I can dynamically set the y range limits (start, end) after the data has been updated. Available options seems to be only applicable for zooming in and out, so I’m a bit lost on how to tackle this seemingly trivial task…

Also tried using ‘bounds’ and ‘min/max_interval’ using DataRange1d or Range1D but these doesn’t seem to quite what I need as well and it seems like a case of not being able to dynamically update x_range and y_range values discussed in following thread:

https://github.com/bokeh/bokeh/issues/4014

Is there a way to do this?

Thanks,

Hi,

You can update any (numerical) range’s “start” and “end” at any time. WIth python code in a Bokeh Server app, or with JS code in a CustomJS callback in a standalone document. It would probably help focus the discussion if you can provide some actual code. If you are runn#ing in to #4014 the workaround is to not use DataRange1d but use the “dumb” Range1d from the start. Since you want to control the range explicitly yourself anyway, that’s a reasonable workaround.

Thanks,

Bryan

···

On Thursday, December 7, 2017 at 1:56:04 PM UTC-6, [email protected] wrote:

Hi,

I’m generating plots from a Bokeh server and I’m trying to keep the y-axis range interval fixed to a value, so that when multiple plots are displayed they have consistent scale.

Padding by percentage or absolute value using range_padding doesn’t quite do the job since the data range varies, and it doesn’t seem like I can dynamically set the y range limits (start, end) after the data has been updated. Available options seems to be only applicable for zooming in and out, so I’m a bit lost on how to tackle this seemingly trivial task…

Also tried using ‘bounds’ and ‘min/max_interval’ using DataRange1d or Range1D but these doesn’t seem to quite what I need as well and it seems like a case of not being able to dynamically update x_range and y_range values discussed in following thread:

https://github.com/bokeh/bokeh/issues/4014

Is there a way to do this?

Thanks,

Thanks for the quick reply! Agree, that’s a simple way to fix the issue and it works - was trying various combinations of DataRange1d to get it to work and was getting quite frustrated. Thanks again for the help.

Joseph

···

On Thursday, 7 December 2017 13:07:32 UTC-8, Bryan Van de ven wrote:

Hi,

You can update any (numerical) range’s “start” and “end” at any time. WIth python code in a Bokeh Server app, or with JS code in a CustomJS callback in a standalone document. It would probably help focus the discussion if you can provide some actual code. If you are runn#ing in to #4014 the workaround is to not use DataRange1d but use the “dumb” Range1d from the start. Since you want to control the range explicitly yourself anyway, that’s a reasonable workaround.

Thanks,

Bryan

On Thursday, December 7, 2017 at 1:56:04 PM UTC-6, [email protected] wrote:

Hi,

I’m generating plots from a Bokeh server and I’m trying to keep the y-axis range interval fixed to a value, so that when multiple plots are displayed they have consistent scale.

Padding by percentage or absolute value using range_padding doesn’t quite do the job since the data range varies, and it doesn’t seem like I can dynamically set the y range limits (start, end) after the data has been updated. Available options seems to be only applicable for zooming in and out, so I’m a bit lost on how to tackle this seemingly trivial task…

Also tried using ‘bounds’ and ‘min/max_interval’ using DataRange1d or Range1D but these doesn’t seem to quite what I need as well and it seems like a case of not being able to dynamically update x_range and y_range values discussed in following thread:

https://github.com/bokeh/bokeh/issues/4014

Is there a way to do this?

Thanks,