In Bokeh, what are 'screen units'?
The web isn't forthright on what these creatures are and I've had no luck gleaning their meaning from the (0.9.3) source code
The Bokeh source uses them in its examples, such as this from 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)
but I don't see them defined anywhere. What other options would 'width_units' support?
Bokeh lets users set renderer locations either by screen units (related to the pixel distance from the origin of the plot) or data units (which uses the mapper that is used to calculate the plot ranges based on the input data)
This helps in cases like adding box annotations, where sometimes you want the box to be linked to screen (perhaps always in the middle of the screen) or linked to data values (having a box at x=10)
The docs: https://github.com/bokeh/bokeh/blob/master/bokeh/enums.py#L46
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With