散景的 'screen units' 是什么?

What are Bokeh's 'screen units'?

在散景中,'screen units'是什么?

网络对这些生物的含义并不直截了当,我也没有从 (0.9.3) 源代码中收集到它们的含义

Bokeh 源代码在其示例中使用了它们,例如 bokeh/_glyph_functions.py for 'rect':

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.rect(x=[1, 2, 3], y=[1, 2, 3], width=10, height=20, color="#CAB2D6",
          width_units="screen", height_units="screen")
show(plot)

但我没有在任何地方看到它们的定义。 'width_units' 支持哪些其他选项?

Bokeh 允许用户通过屏幕单位(与绘图原点的像素距离相关)或数据单位(使用用于根据输入数据计算绘图范围的映射器)设置渲染器位置

这在添加框注释等情况下很有帮助,有时您希望框链接到屏幕(可能总是在屏幕中间)或链接到数据值(在 x=10 处有一个框)

文档: https://github.com/bokeh/bokeh/blob/master/bokeh/enums.py#L46