Range1d class(和其他 Range classes)和 Python 中的默认范围函数有什么区别?

What's the difference between the Range1d class (and the other Range classes) and the default range function in Python?

我知道,答案可能很简单,但我试图理解这个 class 的作用以及它为什么有用,所以我不只是 copy/paste 来自在我需要的时候查看文档。

谢谢!

Python 内置 range 函数与 Bokeh Range 对象之间没有任何关系。 Bokeh Range 对象用于指定绘图轴上的值。

绘图的范围可以是数字和连续的(与 range 有点相似),在这种情况下 Range 具有 startend 属性。例如 Range1dDataRange1d。后者默认为您设置 startend 的额外行为,以便自动显示您的所有数据。

但绘图范围也可能是离散的和分类的,例如月份名称列表(这与 range 完全不同)。 FactorRange 就是一个例子。