annotations#

Renderers for various kinds of annotations that can be added to plots.

class Angular(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Units of angular measurement.

class Annotation(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Base class for all annotation models.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

class Arrow(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render arrows as an annotation.

See Arrows for information on plotting arrows.

end#

Instance of ArrowHead.

end_units#

The unit type for the end_x and end_y attributes. Interpreted as “data space” units by default.

line_alpha#

The line alpha values for the arrow body.

line_cap#

The line cap values for the arrow body.

line_color#

The line color values for the arrow body.

line_dash#

The line dash values for the arrow body.

line_dash_offset#

The line dash offset values for the arrow body.

line_join#

The line join values for the arrow body.

line_width#

The line width values for the arrow body.

start#

Instance of ArrowHead.

start_units#

The unit type for the start_x and start_y attributes. Interpreted as “data space” units by default.

x_end#

The x-coordinates to locate the end of the arrows.

x_start#

The x-coordinates to locate the start of the arrows.

y_end#

The y-coordinates to locate the end of the arrows.

y_start#

The y-coordinates to locate the start of the arrows.

class ArrowHead(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Base class for arrow heads.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

size#

The size, in pixels, of the arrow head.

class Band(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a filled area band along a dimension.

See Bands for information on plotting bands.

base#

The orthogonal coordinates of the upper and lower values.

base_units#

canvas, screen or data

Type:

Units to use for the associated property

dimension#

The direction of the band can be specified by setting this property to “height” (y direction) or “width” (x direction).

fill_alpha#

The fill alpha values for the band.

fill_color#

The fill color values for the band.

hatch_alpha#

The hatch alpha values for the band.

hatch_color#

The hatch color values for the band.

hatch_extra#

The hatch extra values for the band.

hatch_pattern#

The hatch pattern values for the band.

hatch_scale#

The hatch scale values for the band.

hatch_weight#

The hatch weight values for the band.

line_alpha#

The line alpha values for the band.

line_cap#

The line cap values for the band.

line_color#

The line color values for the band.

line_dash#

The line dash values for the band.

line_dash_offset#

The line dash offset values for the band.

line_join#

The line join values for the band.

line_width#

The line width values for the band.

lower#

The coordinates of the lower portion of the filled area band.

lower_units#

canvas, screen or data

Type:

Units to use for the associated property

upper#

The coordinates of the upper portion of the filled area band.

upper_units#

canvas, screen or data

Type:

Units to use for the associated property

class BoxAnnotation(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a shaded rectangular region as an annotation.

See Box annotations for information on plotting box annotations.

border_radius#

Allows the box to have rounded corners.

Note

This property is experimental and may change at any point.

bottom#

The y-coordinates of the bottom edge of the box annotation.

bottom_limit#

Optional bottom limit for box movement.

Note

This property is experimental and may change at any point.

bottom_units#

The unit type for the bottom attribute. Interpreted as data units by default. This doesn’t have any effect if bottom is a node.

editable#

Allows to interactively modify the geometry of this box.

Note

This property is experimental and may change at any point.

handles#

Configure appearance of interaction handles.

Handles can be configured in bulk in an increasing level of specificity, were each level, if defined, overrides the more generic setting:

  • all -> move, resize

  • resize -> sides, corners

  • sides -> left, right, top, bottom

  • corners -> top_left, top_right, bottom_left, bottom_right

Note

This property is experimental and may change at any point.

inverted#

Inverts the geometry of the box, i.e. applies fill and hatch visuals to the outside of the box instead of the inside. Visuals are applied between the box and its parent, e.g. the frame.

left#

The x-coordinates of the left edge of the box annotation.

left_limit#

Optional left limit for box movement.

Note

This property is experimental and may change at any point.

left_units#

The unit type for the left attribute. Interpreted as data units by default. This doesn’t have any effect if left is a node.

max_height#

Allows to set the maximum height of the box.

Note

This property is experimental and may change at any point.

max_width#

Allows to set the minimum height of the box.

Note

This property is experimental and may change at any point.

min_height#

Allows to set the maximum width of the box.

Note

This property is experimental and may change at any point.

min_width#

Allows to set the minimum width of the box.

Note

This property is experimental and may change at any point.

movable#

If editable is set, this property allows to configure in which directions the box can be moved.

Note

This property is experimental and may change at any point.

property nodes: BoxNodes#
resizable#

If editable is set, this property allows to configure which combinations of edges are allowed to be moved, thus allows restrictions on resizing of the box.

Note

This property is experimental and may change at any point.

right#

The x-coordinates of the right edge of the box annotation.

right_limit#

Optional right limit for box movement.

Note

This property is experimental and may change at any point.

right_units#

The unit type for the right attribute. Interpreted as data units by default. This doesn’t have any effect if right is a node.

symmetric#

Indicates whether the box is resizable around its center or its corners.

Note

This property is experimental and may change at any point.

top#

The y-coordinates of the top edge of the box annotation.

top_limit#

Optional top limit for box movement.

Note

This property is experimental and may change at any point.

top_units#

The unit type for the top attribute. Interpreted as data units by default. This doesn’t have any effect if top is a node.

use_handles#

Whether to show interaction (move, resize, etc.) handles.

If handles aren’t used, then the whole annotation, its borders and corners act as if they were interaction handles.

Note

This property is experimental and may change at any point.

class BoxInteractionHandles(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Defines interaction handles for box-like annotations.

all#
bottom#
bottom_left#
bottom_right#
corners#
left#
move#
resize#
right#
sides#
top#
top_left#
top_right#
class ColorBar(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a color bar based on a color mapper.

See Color bars for information on plotting color bars.

color_mapper#

A color mapper containing a color palette to render.

Warning

If the low and high attributes of the ColorMapper aren’t set, ticks and tick labels won’t be rendered. Additionally, if a LogTicker is passed to the ticker argument and either or both of the logarithms of low and high values of the color_mapper are non-numeric (i.e. low=0), the tick and tick labels won’t be rendered.

display_high#

The highest value to display in the color bar. The whole of the color entry containing this value is shown.

display_low#

The lowest value to display in the color bar. The whole of the color entry containing this value is shown.

scale_alpha#

The alpha with which to render the color scale.

class ContourColorBar(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Color bar used for contours.

Supports displaying hatch patterns and line styles that contour plots may have as well as the usual fill styles.

Do not create these objects manually, instead use ContourRenderer.color_bar.

fill_renderer#

Glyph renderer used for filled contour polygons.

levels#

Levels at which the contours are calculated.

line_renderer#

Glyph renderer used for contour lines.

class HTMLAnnotation(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Base class for HTML-based annotations.

Note

All annotations that inherit from this base class can be attached to a canvas, but are not rendered to it, thus they won’t appear in saved plots. Only export_png() function can preserve HTML annotations.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

class HTMLLabel(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a single HTML label as an annotation.

Label will render a single text label at given x and y coordinates, which can be in either screen (pixel) space, or data (axis range) space.

The label can also be configured with a screen space offset from x and y, by using the x_offset and y_offset properties.

Additionally, the label can be rotated with the angle property.

There are also standard text, fill, and line properties to control the appearance of the text, its background, as well as the rectangular bounding box border.

See Labels for information on plotting labels.

angle#

The angle to rotate the text, as measured from the horizontal.

angle_units#

Acceptable values for units are "rad" and "deg"

text#

The text value to render.

text_align#

The text align values for the text.

text_alpha#

The text alpha values for the text.

text_baseline#

The text baseline values for the text.

text_color#

The text color values for the text.

text_font#

The text font values for the text.

text_font_size#

The text font size values for the text.

text_font_style#

The text font style values for the text.

text_line_height#

The text line height values for the text.

text_outline_color#

The text outline color values for the text.

text_outline_width#

The text outline width values for the text.

x#

The x-coordinate in screen coordinates to locate the text anchors.

x_offset#

Offset value to apply to the x-coordinate.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

x_units#

The unit type for the x attribute. Interpreted as data units by default.

y#

The y-coordinate in screen coordinates to locate the text anchors.

y_offset#

Offset value to apply to the y-coordinate.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

y_units#

The unit type for the y attribute. Interpreted as data units by default.

class HTMLLabelSet(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render multiple text labels as annotations.

LabelSet will render multiple text labels at given x and y coordinates, which can be in either screen (pixel) space, or data (axis range) space. In this case (as opposed to the single Label model), x and y can also be the name of a column from a ColumnDataSource, in which case the labels will be “vectorized” using coordinate values from the specified columns.

The label can also be configured with a screen space offset from x and y, by using the x_offset and y_offset properties. These offsets may be vectorized by giving the name of a data source column.

Additionally, the label can be rotated with the angle property (which may also be a column name.)

There are also standard text, fill, and line properties to control the appearance of the text, its background, as well as the rectangular bounding box border.

The data source is provided by setting the source property.

angle#

The angles to rotate the text, as measured from the horizontal.

angle_units#

deg, rad, grad or turn

Type:

Units to use for the associated property

background_fill_alpha#

The fill alpha values for the text bounding box.

background_fill_color#

The fill color values for the text bounding box.

border_line_alpha#

The line alpha values for the text bounding box.

border_line_cap#

The line cap values for the text bounding box.

border_line_color#

The line color values for the text bounding box.

border_line_dash#

The line dash values for the text bounding box.

border_line_dash_offset#

The line dash offset values for the text bounding box.

border_line_join#

The line join values for the text bounding box.

border_line_width#

The line width values for the text bounding box.

text#

The text values to render.

text_align#

The text align values for the text.

text_alpha#

The text alpha values for the text.

text_baseline#

The text baseline values for the text.

text_color#

The text color values for the text.

text_font#

The text font values for the text.

text_font_size#

The text font size values for the text.

text_font_style#

The text font style values for the text.

text_line_height#

The text line height values for the text.

text_outline_color#

The text outline color values for the text.

text_outline_width#

The text outline width values for the text.

x#

The x-coordinates to locate the text anchors.

x_offset#

Offset values to apply to the x-coordinates.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

x_units#

The unit type for the xs attribute. Interpreted as data units by default.

y#

The y-coordinates to locate the text anchors.

y_offset#

Offset values to apply to the y-coordinates.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

y_units#

The unit type for the ys attribute. Interpreted as data units by default.

class HTMLTitle(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a single title box as an annotation.

See Titles for information on plotting titles.

align#

Alignment of the text in its enclosing space, along the direction of the text.

offset#

Offset the text by a number of pixels (can be positive or negative). Shifts the text in different directions based on the location of the title:

  • above: shifts title right

  • right: shifts title down

  • below: shifts title right

  • left: shifts title up

standoff#
text#

The text value to render.

text_alpha#

An alpha value to use to fill text with.

Acceptable values are floating-point numbers between 0 and 1 (0 being transparent and 1 being opaque).

text_color#

A color to use to fill text with.

Acceptable values are:

  • any of the named CSS colors, e.g 'green', 'indigo'

  • RGB(A) hex strings, e.g., '#FF0000', '#44444444'

  • CSS4 color strings, e.g., 'rgba(255, 0, 127, 0.6)', 'rgb(0 127 0 / 1.0)', or 'hsl(60deg 100% 50% / 1.0)'

  • a 3-tuple of integers (r, g, b) between 0 and 255

  • a 4-tuple of (r, g, b, a) where r, g, b are integers between 0 and 255, and a is between 0 and 1

  • a 32-bit unsigned integer using the 0xRRGGBBAA byte order pattern

text_font#

Name of a font to use for rendering text, e.g., 'times', 'helvetica'.

text_font_size#
text_font_style#

A style to use for rendering text.

Acceptable values are:

  • 'normal' normal text

  • 'italic' italic text

  • 'bold' bold text

text_line_height#

How much additional space should be allocated for the title. The value is provided as a number, but should be treated as a percentage of font size. The default is 100%, which means no additional space will be used.

text_outline_color#

A color to use for an outline stroke.

text_outline_width#

A width for the outline stroke in pixels when an outline color is defined for the text.

vertical_align#

Alignment of the text in its enclosing space, across the direction of the text.

class ImperialLength(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Imperial units of length measurement.

class Label(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a single text label as an annotation.

Label will render a single text label at given x and y coordinates, which can be in either screen (pixel) space, or data (axis range) space.

The label can also be configured with a screen space offset from x and y, by using the x_offset and y_offset properties.

Additionally, the label can be rotated with the angle property.

There are also standard text, fill, and line properties to control the appearance of the text, its background, as well as the rectangular bounding box border.

See Labels for information on plotting labels.

anchor#

Position within the bounding box of the text of a label to which x and y coordinates are anchored to.

Note

This property is experimental and may change at any point.

angle#

The angle to rotate the text, as measured from the horizontal.

angle_units#

Acceptable values for units are "rad" and "deg".

direction#

The direction for the angle of the label.

Note

This property is experimental and may change at any point.

editable#

Allows to interactively modify the geometry of this label.

Note

This property is experimental and may change at any point.

x#

The x-coordinate in screen coordinates to locate the text anchors.

x_offset#

Offset value to apply to the x-coordinate.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

x_units#

The unit type for the x attribute. Interpreted as data units by default. This doesn’t have any effect if x is a node.

y#

The y-coordinate in screen coordinates to locate the text anchors.

y_offset#

Offset value to apply to the y-coordinate.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

y_units#

The unit type for the y attribute. Interpreted as data units by default. This doesn’t have any effect if y is a node.

class LabelSet(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render multiple text labels as annotations.

LabelSet will render multiple text labels at given x and y coordinates, which can be in either screen (pixel) space, or data (axis range) space. In this case (as opposed to the single Label model), x and y can also be the name of a column from a ColumnDataSource, in which case the labels will be “vectorized” using coordinate values from the specified columns.

The label can also be configured with a screen space offset from x and y, by using the x_offset and y_offset properties. These offsets may be vectorized by giving the name of a data source column.

Additionally, the label can be rotated with the angle property (which may also be a column name.)

There are also standard text, fill, and line properties to control the appearance of the text, its background, as well as the rectangular bounding box border.

The data source is provided by setting the source property.

angle#

The angles to rotate the text, as measured from the horizontal.

angle_units#

deg, rad, grad or turn

Type:

Units to use for the associated property

background_fill_alpha#

The fill alpha values for the text bounding box.

background_fill_color#

The fill color values for the text bounding box.

background_hatch_alpha#

The hatch alpha values for the text bounding box.

background_hatch_color#

The hatch color values for the text bounding box.

background_hatch_extra#

The hatch extra values for the text bounding box.

background_hatch_pattern#

The hatch pattern values for the text bounding box.

background_hatch_scale#

The hatch scale values for the text bounding box.

background_hatch_weight#

The hatch weight values for the text bounding box.

border_line_alpha#

The line alpha values for the text bounding box.

border_line_cap#

The line cap values for the text bounding box.

border_line_color#

The line color values for the text bounding box.

border_line_dash#

The line dash values for the text bounding box.

border_line_dash_offset#

The line dash offset values for the text bounding box.

border_line_join#

The line join values for the text bounding box.

border_line_width#

The line width values for the text bounding box.

text#

The text values to render.

text_align#

The text align values for the text.

text_alpha#

The text alpha values for the text.

text_baseline#

The text baseline values for the text.

text_color#

The text color values for the text.

text_font#

The text font values for the text.

text_font_size#

The text font size values for the text.

text_font_style#

The text font style values for the text.

text_line_height#

The text line height values for the text.

text_outline_color#

The text outline color values for the text.

text_outline_width#

The text outline width values for the text.

x#

The x-coordinates to locate the text anchors.

x_offset#

Offset values to apply to the x-coordinates.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

x_units#

The unit type for the xs attribute. Interpreted as data units by default.

y#

The y-coordinates to locate the text anchors.

y_offset#

Offset values to apply to the y-coordinates.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

y_units#

The unit type for the ys attribute. Interpreted as data units by default.

class Legend(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render informational legends for a plot.

See Legends for information on plotting legends.

js_on_click(handler: JsEventCallback) None[source]#

Set up a JavaScript handler for legend item clicks.

on_click(handler: PyEventCallback) None[source]#

Set up a handler for legend item clicks.

background_fill_alpha#

The fill alpha for the legend background style.

background_fill_color#

The fill color for the legend background style.

background_hatch_alpha#

The hatch alpha for the legend background style.

background_hatch_color#

The hatch color for the legend background style.

background_hatch_extra#

The hatch extra for the legend background style.

background_hatch_pattern#

The hatch pattern for the legend background style.

background_hatch_scale#

The hatch scale for the legend background style.

background_hatch_weight#

The hatch weight for the legend background style.

border_line_alpha#

The line alpha for the legend border outline.

border_line_cap#

The line cap for the legend border outline.

border_line_color#

The line color for the legend border outline.

border_line_dash#

The line dash for the legend border outline.

border_line_dash_offset#

The line dash offset for the legend border outline.

border_line_join#

The line join for the legend border outline.

border_line_width#

The line width for the legend border outline.

border_radius#

Allows the box to have rounded corners.

click_policy#

Defines what happens when a lengend’s item is clicked.

glyph_height#

The height (in pixels) that the rendered legend glyph should occupy.

glyph_width#

The width (in pixels) that the rendered legend glyph should occupy.

inactive_fill_alpha#

The fill alpha for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_fill_color#

The fill color for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_hatch_alpha#

The hatch alpha for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_hatch_color#

The hatch color for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_hatch_extra#

The hatch extra for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_hatch_pattern#

The hatch pattern for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_hatch_scale#

The hatch scale for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

inactive_hatch_weight#

The hatch weight for the legend item style when inactive. These control an overlay on the item that can be used to obscure it when the corresponding glyph is inactive (e.g. by making it semi-transparent).

item_background_fill_alpha#

The fill alpha for the legend items’ background style.

item_background_fill_color#

The fill color for the legend items’ background style.

item_background_hatch_alpha#

The hatch alpha for the legend items’ background style.

item_background_hatch_color#

The hatch color for the legend items’ background style.

item_background_hatch_extra#

The hatch extra for the legend items’ background style.

item_background_hatch_pattern#

The hatch pattern for the legend items’ background style.

item_background_hatch_scale#

The hatch scale for the legend items’ background style.

item_background_hatch_weight#

The hatch weight for the legend items’ background style.

item_background_policy#

Defines which items to style, if item_background_fill is configured.

items#

A list of LegendItem instances to be rendered in the legend.

This can be specified explicitly, for instance:

legend = Legend(items=[
    LegendItem(label="sin(x)",   renderers=[r0, r1]),
    LegendItem(label="2*sin(x)", renderers=[r2]),
    LegendItem(label="3*sin(x)", renderers=[r3, r4])
])

But as a convenience, can also be given more compactly as a list of tuples:

legend = Legend(items=[
    ("sin(x)",   [r0, r1]),
    ("2*sin(x)", [r2]),
    ("3*sin(x)", [r3, r4])
])

where each tuple is of the form: (label, renderers).

label_height#

The minimum height (in pixels) of the area that legend labels should occupy.

label_standoff#

The distance (in pixels) to separate the label from its associated glyph.

label_text_align#

The text align for the legend labels.

label_text_alpha#

The text alpha for the legend labels.

label_text_baseline#

The text baseline for the legend labels.

label_text_color#

The text color for the legend labels.

label_text_font#

The text font for the legend labels.

label_text_font_size#

The text font size for the legend labels.

label_text_font_style#

The text font style for the legend labels.

label_text_line_height#

The text line height for the legend labels.

label_text_outline_color#

The text outline color for the legend labels.

label_text_outline_width#

The text outline width for the legend labels.

label_width#

The minimum width (in pixels) of the area that legend labels should occupy.

location#

The location where the legend should draw itself. It’s either one of LegendLocation’s enumerated values, or a (x, y) tuple indicating an absolute location in screen coordinates (pixels from the bottom-left corner).

margin#

Amount of margin around the legend.

ncols#

The number of columns in the legend’s layout. By default it’s either one column if the orientation is vertical or the number of items in the legend otherwise. ncols takes precedence over nrows for horizontal orientation.

nrows#

The number of rows in the legend’s layout. By default it’s either one row if the orientation is horizontal or the number of items in the legend otherwise. nrows takes precedence over ncols for vertical orientation.

orientation#

Whether the legend entries should be placed vertically or horizontally when they are drawn.

padding#

Amount of padding between the contents of the legend and its border.

Only applicable when border is visible.

spacing#

Amount of spacing (in pixels) between legend entries.

title#

The title text to render.

title_location#

Specifies on which side of the legend the title will be located. Titles on the left or right side will be rotated accordingly.

title_standoff#

The distance (in pixels) to separate the title from the legend.

title_text_align#

The text align values for the title text.

title_text_alpha#

The text alpha values for the title text.

title_text_baseline#

The text baseline values for the title text.

title_text_color#

The text color values for the title text.

title_text_font#

The text font values for the title text.

title_text_font_size#

The text font size values for the title text.

title_text_font_style#

The text font style values for the title text.

title_text_line_height#

The text line height values for the title text.

title_text_outline_color#

The text outline color values for the title text.

title_text_outline_width#

The text outline width values for the title text.

class LegendItem(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
index#

The column data index to use for drawing the representative items.

If None (the default), then Bokeh will automatically choose an index to use. If the label does not refer to a data column name, this is typically the first data point in the data source. Otherwise, if the label does refer to a column name, the legend will have “groupby” behavior, and will choose and display representative points from every “group” in the column.

If set to a number, Bokeh will use that number as the index in all cases.

label#

A label for this legend. Can be a string, or a column of a ColumnDataSource. If label is a field, then it must be in the renderers’ data_source.

renderers#

A list of the glyph renderers to draw in the legend. If label is a field, then all data_sources of renderers must be the same.

visible#

Whether the legend item should be displayed. See Hiding legend items in the user guide.

class Metric(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Model for defining metric units of measurement.

is_known(unit: str) bool[source]#
base_unit#

The short name of the base unit, e.g. "m" for meters or "eV" for electron volts.

full_unit#

The full name of the base unit, e.g. "meter" or "electronvolt".

class MetricLength(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Metric units of length measurement.

class NormalHead(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a closed-body arrow head.

fill_alpha#

The fill alpha values for the arrow head interior.

fill_color#

The fill color values for the arrow head interior.

hatch_alpha#

The hatch alpha values for the arrow head interior.

hatch_color#

The hatch color values for the arrow head interior.

hatch_extra#

The hatch extra values for the arrow head interior.

hatch_pattern#

The hatch pattern values for the arrow head interior.

hatch_scale#

The hatch scale values for the arrow head interior.

hatch_weight#

The hatch weight values for the arrow head interior.

line_alpha#

The line alpha values for the arrow head outline.

line_cap#

The line cap values for the arrow head outline.

line_color#

The line color values for the arrow head outline.

line_dash#

The line dash values for the arrow head outline.

line_dash_offset#

The line dash offset values for the arrow head outline.

line_join#

The line join values for the arrow head outline.

line_width#

The line width values for the arrow head outline.

class OpenHead(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render an open-body arrow head.

line_alpha#

The line alpha values for the arrow head outline.

line_cap#

The line cap values for the arrow head outline.

line_color#

The line color values for the arrow head outline.

line_dash#

The line dash values for the arrow head outline.

line_dash_offset#

The line dash offset values for the arrow head outline.

line_join#

The line join values for the arrow head outline.

line_width#

The line width values for the arrow head outline.

class PolyAnnotation(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a shaded polygonal region as an annotation.

See Polygon annotations for information on plotting polygon annotations.

editable#

Allows to interactively modify the geometry of this polygon.

Note

This property is experimental and may change at any point.

fill_alpha#

The fill alpha values for the polygon.

fill_color#

The fill color values for the polygon.

hatch_alpha#

The hatch alpha values for the polygon.

hatch_color#

The hatch color values for the polygon.

hatch_extra#

The hatch extra values for the polygon.

hatch_pattern#

The hatch pattern values for the polygon.

hatch_scale#

The hatch scale values for the polygon.

hatch_weight#

The hatch weight values for the polygon.

hover_fill_alpha#

The fill alpha values for the polygon when hovering over.

hover_fill_color#

The fill color values for the polygon when hovering over.

hover_hatch_alpha#

The hatch alpha values for the polygon when hovering over.

hover_hatch_color#

The hatch color values for the polygon when hovering over.

hover_hatch_extra#

The hatch extra values for the polygon when hovering over.

hover_hatch_pattern#

The hatch pattern values for the polygon when hovering over.

hover_hatch_scale#

The hatch scale values for the polygon when hovering over.

hover_hatch_weight#

The hatch weight values for the polygon when hovering over.

hover_line_alpha#

The line alpha values for the polygon when hovering over.

hover_line_cap#

The line cap values for the polygon when hovering over.

hover_line_color#

The line color values for the polygon when hovering over.

hover_line_dash#

The line dash values for the polygon when hovering over.

hover_line_dash_offset#

The line dash offset values for the polygon when hovering over.

hover_line_join#

The line join values for the polygon when hovering over.

hover_line_width#

The line width values for the polygon when hovering over.

line_alpha#

The line alpha values for the polygon.

line_cap#

The line cap values for the polygon.

line_color#

The line color values for the polygon.

line_dash#

The line dash values for the polygon.

line_dash_offset#

The line dash offset values for the polygon.

line_join#

The line join values for the polygon.

line_width#

The line width values for the polygon.

xs#

The x-coordinates of the region to draw.

xs_units#

The unit type for the xs attribute. Interpreted as data units by default.

ys#

The y-coordinates of the region to draw.

ys_units#

The unit type for the ys attribute. Interpreted as data units by default.

class ReciprocalMetric(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Model for defining reciprocal metric units of measurement, e.g. m^{-1}.

class ReciprocalMetricLength(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Metric units of reciprocal length measurement.

class ScaleBar(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Represents a scale bar annotation.

anchor#

The origin for scale bar positioning.

If "auto" in any or both dimensions, then the anchor in these dimensions will be determined based on the position, so that the scale bar looks good.

background_fill_alpha#

The fill alpha for the scale bar background fill style.

background_fill_color#

The fill color for the scale bar background fill style.

background_hatch_alpha#

The hatch alpha for the scale bar background hatch style.

background_hatch_color#

The hatch color for the scale bar background hatch style.

background_hatch_extra#

The hatch extra for the scale bar background hatch style.

background_hatch_pattern#

The hatch pattern for the scale bar background hatch style.

background_hatch_scale#

The hatch scale for the scale bar background hatch style.

background_hatch_weight#

The hatch weight for the scale bar background hatch style.

bar_length#

The length of the bar.

This is either a fraction of the frame, a number of pixels or distance in the data space, depending on the configuration of bar_length_units.

bar_length_units#

Defines how to interpret bar_length.

Supported values are:

  • "screen" - the length is provided in pixels or as a percentage of the parent container (e.g. the frame) if the value provided is in [0, 1] range

  • "data" - the length is provided in data space units

  • "percent" - the length is a percentage of the parent container (e.g. the frame)

Note

"data" units assume a linear scale or a linear like scale (e.g. categorical scale) is used. Otherwise the length of the bar would be position dependent.

bar_line_alpha#

The line alpha values for the bar line style.

bar_line_cap#

The line cap values for the bar line style.

bar_line_color#

The line color values for the bar line style.

bar_line_dash#

The line dash values for the bar line style.

bar_line_dash_offset#

The line dash offset values for the bar line style.

bar_line_join#

The line join values for the bar line style.

bar_line_width#

The line width values for the bar line style.

border_line_alpha#

The line alpha for the scale bar border line style.

border_line_cap#

The line cap for the scale bar border line style.

border_line_color#

The line color for the scale bar border line style.

border_line_dash#

The line dash for the scale bar border line style.

border_line_dash_offset#

The line dash offset for the scale bar border line style.

border_line_join#

The line join for the scale bar border line style.

border_line_width#

The line width for the scale bar border line style.

dimensional#

Defines the units of measurement.

label#

The label template.

This can use special variables:

  • @{value} The current value. Optionally can provide a number formatter with e.g. @{value}{%.2f}.

  • @{unit} The unit of measurement.

label_align#

Specifies where to align scale bar’s label along the bar.

This property effective when placing the label above or below a horizontal scale bar, or left or right of a vertical one.

label_location#

Specifies on which side of the scale bar the label will be located.

label_standoff#

The distance (in pixels) to separate the label from the scale bar.

label_text_align#

The text align values for the label text style.

label_text_alpha#

The text alpha values for the label text style.

label_text_baseline#

The text baseline values for the label text style.

label_text_color#

The text color values for the label text style.

label_text_font#

The text font values for the label text style.

label_text_font_size#

The text font size values for the label text style.

label_text_font_style#

The text font style values for the label text style.

label_text_line_height#

The text line height values for the label text style.

label_text_outline_color#

The text outline color values for the label text style.

label_text_outline_width#

The text outline width values for the label text style.

length_sizing#

Defines how the length of the bar is interpreted.

This can either be:

  • "adaptive" - the computed length is fit into a set of ticks provided be the dimensional model. If no ticks are provided, then the behavior is the same as if "exact" sizing was used

  • "exact" - the computed length is used as-is

location#

Position of the scale bar within the parent container (usually cartesian frame).

margin#

Amount of margin (in pixels) around the outside of the scale bar.

orientation#

Whether the scale bar should be oriented horizontally or vertically.

padding#

Amount of padding (in pixels) between the contents of the scale bar and its border.

range#

The range for which to display the scale.

This can be either a range reference or "auto", in which case the scale bar will pick the default x or y range of the frame, depending on the orientation of the scale bar.

ticker#

A ticker to use for computing locations of axis components.

Note that if using the default fixed ticker with no predefined ticks, then the appearance of the scale bar will be just a solid bar with no additional markings.

title#

The title text to render.

title_align#

Specifies where to align scale bar’s title along the bar.

This property effective when placing the title above or below a horizontal scale bar, or left or right of a vertical one.

title_location#

Specifies on which side of the legend the title will be located.

title_standoff#

The distance (in pixels) to separate the title from the scale bar.

title_text_align#

The text align values for the title text style.

title_text_alpha#

The text alpha values for the title text style.

title_text_baseline#

The text baseline values for the title text style.

title_text_color#

The text color values for the title text style.

title_text_font#

The text font values for the title text style.

title_text_font_size#

The text font size values for the title text style.

title_text_font_style#

The text font style values for the title text style.

title_text_line_height#

The text line height values for the title text style.

title_text_outline_color#

The text outline color values for the title text style.

title_text_outline_width#

The text outline width values for the title text style.

unit#

The unit of the range property.

x_units#

The interpretation of x coordinate values provided in position property.

y_units#

The interpretation of y coordinate values provided in position property.

class SizeBar(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

SizeBar is a visual indicator that allows you to gauge the size of radial glyphs, like Circle or Ngon, which essentially allows you to add a third dimension to 2D scatter plots.

bounds#

Allows to limit the range of displayed radii.

glyph_fill_alpha#

The fill alpha of the glyph.

glyph_fill_color#

The fill color of the glyph.

glyph_hatch_alpha#

The hatch alpha of the glyph.

glyph_hatch_color#

The hatch color of the glyph.

glyph_hatch_extra#

The hatch extra of the glyph.

glyph_hatch_pattern#

The hatch pattern of the glyph.

glyph_hatch_scale#

The hatch scale of the glyph.

glyph_hatch_weight#

The hatch weight of the glyph.

glyph_line_alpha#

The line alpha of the glyph.

glyph_line_cap#

The line cap of the glyph.

glyph_line_color#

The line color of the glyph.

glyph_line_dash#

The line dash of the glyph.

glyph_line_dash_offset#

The line dash offset of the glyph.

glyph_line_join#

The line join of the glyph.

glyph_line_width#

The line width of the glyph.

renderer#

A reference to a radial glyph renderer or "auto".

If a plot only contains a single radial glyph renderer, then it’s safe to use the automatic mode ("auto"). In case there are more radial glyph renderers, renderer property allows to select the one to use with this SizeBar.

class Slope(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a sloped line as an annotation.

See Slopes for information on plotting slopes.

above_fill_alpha#

The fill alpha values for the area above the line.

above_fill_color#

The fill color values for the area above the line.

above_hatch_alpha#

The hatch alpha values for the area above the line.

above_hatch_color#

The hatch color values for the area above the line.

above_hatch_extra#

The hatch extra values for the area above the line.

above_hatch_pattern#

The hatch pattern values for the area above the line.

above_hatch_scale#

The hatch scale values for the area above the line.

above_hatch_weight#

The hatch weight values for the area above the line.

below_fill_alpha#

The fill alpha values for the area below the line.

below_fill_color#

The fill color values for the area below the line.

below_hatch_alpha#

The hatch alpha values for the area below the line.

below_hatch_color#

The hatch color values for the area below the line.

below_hatch_extra#

The hatch extra values for the area below the line.

below_hatch_pattern#

The hatch pattern values for the area below the line.

below_hatch_scale#

The hatch scale values for the area below the line.

below_hatch_weight#

The hatch weight values for the area below the line.

gradient#

The gradient of the line, in data units

line_alpha#

The line alpha values for the line.

line_cap#

The line cap values for the line.

line_color#

The line color values for the line.

line_dash#

The line dash values for the line.

line_dash_offset#

The line dash offset values for the line.

line_join#

The line join values for the line.

line_width#

The line width values for the line.

y_intercept#

The y intercept of the line, in data units

class Span(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a horizontal or vertical line span.

See Spans for information on plotting spans.

dimension#

The direction of the span can be specified by setting this property to “height” (y direction) or “width” (x direction).

editable#

Allows to interactively modify the geometry of this span.

Note

This property is experimental and may change at any point.

hover_line_alpha#

The line alpha values for the span when hovering over.

hover_line_cap#

The line cap values for the span when hovering over.

hover_line_color#

The line color values for the span when hovering over.

hover_line_dash#

The line dash values for the span when hovering over.

hover_line_dash_offset#

The line dash offset values for the span when hovering over.

hover_line_join#

The line join values for the span when hovering over.

hover_line_width#

The line width values for the span when hovering over.

line_alpha#

The line alpha values for the span.

line_cap#

The line cap values for the span.

line_color#

The line color values for the span.

line_dash#

The line dash values for the span.

line_dash_offset#

The line dash offset values for the span.

line_join#

The line join values for the span.

line_width#

The line width values for the span.

location#

The location of the span, along dimension.

location_units#

The unit type for the location attribute. Interpreted as “data space” units by default.

class TeeHead(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a tee-style arrow head.

line_alpha#

The line alpha values for the arrow head outline.

line_cap#

The line cap values for the arrow head outline.

line_color#

The line color values for the arrow head outline.

line_dash#

The line dash values for the arrow head outline.

line_dash_offset#

The line dash offset values for the arrow head outline.

line_join#

The line join values for the arrow head outline.

line_width#

The line width values for the arrow head outline.

class TextAnnotation(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Base class for text annotation models such as labels and titles.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

background_fill_alpha#

The fill alpha values for the text bounding box.

background_fill_color#

The fill color values for the text bounding box.

background_hatch_alpha#

The hatch alpha values for the text bounding box.

background_hatch_color#

The hatch color values for the text bounding box.

background_hatch_extra#

The hatch extra values for the text bounding box.

background_hatch_pattern#

The hatch pattern values for the text bounding box.

background_hatch_scale#

The hatch scale values for the text bounding box.

background_hatch_weight#

The hatch weight values for the text bounding box.

border_line_alpha#

The line alpha values for the text bounding box.

border_line_cap#

The line cap values for the text bounding box.

border_line_color#

The line color values for the text bounding box.

border_line_dash#

The line dash values for the text bounding box.

border_line_dash_offset#

The line dash offset values for the text bounding box.

border_line_join#

The line join values for the text bounding box.

border_line_width#

The line width values for the text bounding box.

border_radius#

Allows label’s box to have rounded corners. For the best results, it should be used in combination with padding.

Note

This property is experimental and may change at any point.

padding#

Extra space between the text of a label and its bounding box (border).

Note

This property is experimental and may change at any point.

text#

A text or LaTeX notation to render.

text_align#

The text align values for the text.

text_alpha#

The text alpha values for the text.

text_baseline#

The text baseline values for the text.

text_color#

The text color values for the text.

text_font#

The text font values for the text.

text_font_size#

The text font size values for the text.

text_font_style#

The text font style values for the text.

text_line_height#

The text line height values for the text.

text_outline_color#

The text outline color values for the text.

text_outline_width#

The text outline width values for the text.

class Title(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a single title box as an annotation.

See Titles for information on plotting titles.

align#

Alignment of the text in its enclosing space, along the direction of the text.

offset#

Offset the text by a number of pixels (can be positive or negative). Shifts the text in different directions based on the location of the title:

  • above: shifts title right

  • right: shifts title down

  • below: shifts title right

  • left: shifts title up

standoff#
vertical_align#

Alignment of the text in its enclosing space, across the direction of the text.

class ToolbarPanel(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
toolbar#

A toolbar to display.

class VeeHead(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a vee-style arrow head.

fill_alpha#

The fill alpha values for the arrow head interior.

fill_color#

The fill color values for the arrow head interior.

hatch_alpha#

The hatch alpha values for the arrow head interior.

hatch_color#

The hatch color values for the arrow head interior.

hatch_extra#

The hatch extra values for the arrow head interior.

hatch_pattern#

The hatch pattern values for the arrow head interior.

hatch_scale#

The hatch scale values for the arrow head interior.

hatch_weight#

The hatch weight values for the arrow head interior.

line_alpha#

The line alpha values for the arrow head outline.

line_cap#

The line cap values for the arrow head outline.

line_color#

The line color values for the arrow head outline.

line_dash#

The line dash values for the arrow head outline.

line_dash_offset#

The line dash offset values for the arrow head outline.

line_join#

The line join values for the arrow head outline.

line_width#

The line width values for the arrow head outline.

class Whisker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Render a whisker along a dimension.

See Whiskers for information on plotting whiskers.

base#

The orthogonal coordinates of the upper and lower values.

base_units#

canvas, screen or data

Type:

Units to use for the associated property

dimension#

The direction of the whisker can be specified by setting this property to “height” (y direction) or “width” (x direction).

line_alpha#

The line alpha values for the whisker body.

line_cap#

The line cap values for the whisker body.

line_color#

The line color values for the whisker body.

line_dash#

The line dash values for the whisker body.

line_dash_offset#

The line dash offset values for the whisker body.

line_join#

The line join values for the whisker body.

line_width#

The line width values for the whisker body.

lower#

The coordinates of the lower end of the whiskers.

lower_head#

Instance of ArrowHead.

lower_units#

canvas, screen or data

Type:

Units to use for the associated property

upper#

The coordinates of the upper end of the whiskers.

upper_head#

Instance of ArrowHead.

upper_units#

canvas, screen or data

Type:

Units to use for the associated property