简体   繁体   English

如何查询bokeh中的自动设置轴范围?

[英]How to query auto set axis bounds in bokeh?

I've created a plot and let bokeh choose the axis bounds automatically. 我创建了一个图,让bokeh自动选择轴范围。 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. 一种明显的方法是查询fig.y_range.startfig.y_range.end ,但是当自动缩放时,它们似乎设置为None,因此它们看起来像输入参数。

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. 此信息在Python中不可用,这些界限仅在浏览器中的JavaScript中计算。 If you need explicit details/control, you will need to set the ranges manually, eg 如果您需要明确的详细信息/控件,则需要手动设置范围,例如

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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