
PolyDraw: The PolyDraw stream adds a bokeh tool to the source plot, which allows drawing, dragging and deleting polygons and paths. PointDraw: The PointDraw stream adds a bokeh tool to the source plot, which allows drawing, dragging and deleting points.īo圎dit: The Bo圎dit stream adds a bokeh tool to the source plot, which allows drawing, dragging and deleting boxes.įreehandDraw: The FreehandDraw stream adds a bokeh tool to the source plot, which allows freehand drawing on the plot canvas These tools allow drawing and annotating a plot and accessing the annotation back in Python. Note: In the notebook stretching and scaling the height does not increase the size of a cell.Īs a simple example let us declare a plot that has a fixed height but stretches to fit all available horizontal space:Īnother commonly useful set of tools are the drawing tools which are integrated with the linked streams introduced in the Custom Interactivity guide. Stretch_height: If a width but neither a height or aspect are defined the plot will stretch to fill all available vertical space. Stretch_width: If a height but neither a width or aspect are defined the plot will stretch to fill all available horizontal space.

Stretch_both: If neither a width, height or aspect are defined the plot will stretch to fill all available space. Scaling ensures that the aspect ratio of the plot is maintained. Scale_both: If neither a width or a height are defined but a fixed aspect is defined both axes will be scaled up to the maximum size of the container. This leaves four different responsive modes: when width and height or width and aspect are set the plot is set to a fixed size, ignoring any responsive option. Specifically responsive mode will only work if at least one dimension of the plot is left undefined, e.g.


If enabled, the behavior of responsive modes depends on whether an aspect or width/height option is set. Since bokeh plots are rendered within a browser window which can be resized dynamically it supports responsive sizing modes allowing the plot to rescale when the window it is placed in is changed. Here’s an example of HoloViews Elements using a Bokeh backend, with bokeh’s style options: Not also that most of these options support vectorized style mapping as described in the Style Mapping user guide.
