简体   繁体   中英

How to query auto set axis bounds in bokeh?

I've created a plot and let bokeh choose the axis bounds automatically. Now I want to know what the min and max values of that axis are (specifically because I want to overlay the plot of a mathematical function and want to know over what range to evaluate it).

The obvious approach was to query fig.y_range.start and fig.y_range.end , but it appears those are set to None when autoscaled, so they look like input parameters.

How do I determine what the results of autoscaling were?

This information is not available in Python, those bounds are only computed in the browser, in JavaScript. If you need explicit details/control, you will need to set the ranges manually, eg

p = figure(x_range=(0, 137))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM