bokeh.models.annotations¶Renderers for various kinds of annotations that can be added to Bokeh plots
BoxAnnotation(**kwargs)¶Bases: bokeh.models.renderers.Renderer
Render an annotation box “shade” thing
bottom¶property type: Either(Auto, NumberSpec(‘bottom’))
The y-coordinates of the bottom edge of the box annotation.
bottom_units¶property type: Enum(‘screen’, ‘data’)
The unit type for the bottom attribute. Interpreted as “data space” units by default.
fill_alpha¶property type: NumberSpec(1.0)
The fill alpha values for the shades.
fill_color¶property type: ColorSpec(‘gray’)
The fill color values for the shades.
left¶property type: Either(Auto, NumberSpec(‘left’))
The x-coordinates of the left edge of the box annotation.
left_units¶property type: Enum(‘screen’, ‘data’)
The unit type for the left attribute. Interpreted as “data space” units by default.
level¶property type: Enum(‘image’, ‘underlay’, ‘glyph’, ‘annotation’, ‘overlay’, ‘tool’)
Specifies the level in which to render the box annotation.
line_alpha¶property type: NumberSpec(1.0)
The line alpha values for the shades.
line_color¶property type: ColorSpec(‘black’)
The line color values for the shades.
line_dash¶property type: DashPattern
The line dash values for the shades.
line_width¶property type: NumberSpec(1)
The line width values for the shades.
right¶property type: Either(Auto, NumberSpec(‘right’))
The x-coordinates of the right edge of the box annotation.
right_units¶property type: Enum(‘screen’, ‘data’)
The unit type for the right attribute. Interpreted as “data space” units by default.
top¶property type: Either(Auto, NumberSpec(‘top’))
The y-coordinates of the top edge of the box annotation.
top_units¶property type: Enum(‘screen’, ‘data’)
The unit type for the top attribute. Interpreted as “data space” units by default.
[
  {
    "attributes": {
      "bottom": "auto",
      "bottom_units": "data",
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "4b486572-f7bf-4f96-ac63-27ea6b8fca70",
      "left": "auto",
      "left_units": "data",
      "level": "annotation",
      "line_alpha": {
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "value": 1
      },
      "name": null,
      "plot": null,
      "right": "auto",
      "right_units": "data",
      "tags": [],
      "top": "auto",
      "top_units": "data",
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "4b486572-f7bf-4f96-ac63-27ea6b8fca70",
    "type": "BoxAnnotation"
  }
]
Legend(**kwargs)¶Bases: bokeh.models.renderers.Renderer
Render informational legends for a plot.
background_fill_alpha¶property type: NumberSpec(1.0)
The fill alpha for the legend background style.
background_fill_color¶property type: ColorSpec(‘gray’)
The fill color for the legend background style.
border_line_alpha¶property type: NumberSpec(1.0)
The line alpha for the legend border outline.
border_line_cap¶property type: Enum(‘butt’, ‘round’, ‘square’)
The line cap for the legend border outline.
border_line_color¶property type: ColorSpec(‘black’)
The line color for the legend border outline.
border_line_dash¶property type: DashPattern
The line dash for the legend border outline.
border_line_join¶property type: Enum(‘miter’, ‘round’, ‘bevel’)
The line join for the legend border outline.
border_line_width¶property type: NumberSpec(1)
The line width for the legend border outline.
glyph_height¶property type: Int
The height (in pixels) that the rendered legend glyph should occupy.
label_height¶property type: Int
The height (in pixels) of the area that legend labels should occupy.
label_standoff¶property type: Int
The distance (in pixels) to separate the label from its associated glyph.
label_text_align¶property type: Enum(‘left’, ‘right’, ‘center’)
The text align for the legend labels.
label_text_alpha¶property type: NumberSpec(1.0)
The text alpha for the legend labels.
label_text_baseline¶property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)
The text baseline for the legend labels.
label_text_color¶property type: ColorSpec(‘#444444’)
The text color for the legend labels.
label_text_font_size¶property type: FontSizeSpec(‘12pt’)
The text font size for the legend labels.
label_text_font_style¶property type: Enum(‘normal’, ‘italic’, ‘bold’)
The text font style for the legend labels.
legends¶property type: List(Tuple(String, List(Instance(GlyphRenderer))))
A list of tuples that maps text labels to the legend to corresponding renderers that should draw sample representations for those labels.
Note
The legends attribute may also be set from a dict or OrderedDict,
but note that if a dict is used, the order of the legend entries is
unspecified.
[
  {
    "attributes": {
      "background_fill_alpha": {
        "value": 1.0
      },
      "background_fill_color": {
        "value": "gray"
      },
      "border_line_alpha": {
        "value": 1.0
      },
      "border_line_cap": "butt",
      "border_line_color": {
        "value": "black"
      },
      "border_line_dash": [],
      "border_line_dash_offset": 0,
      "border_line_join": "miter",
      "border_line_width": {
        "value": 1
      },
      "doc": null,
      "glyph_height": 20,
      "glyph_width": 20,
      "id": "308dbfb0-ea22-4cf7-8134-afefa0d5f3bd",
      "label_height": 20,
      "label_standoff": 15,
      "label_text_align": "left",
      "label_text_alpha": {
        "value": 1.0
      },
      "label_text_baseline": "bottom",
      "label_text_color": {
        "value": "#444444"
      },
      "label_text_font": "Helvetica",
      "label_text_font_size": {
        "field": "12pt"
      },
      "label_text_font_style": "normal",
      "label_width": 50,
      "legend_padding": 10,
      "legend_spacing": 3,
      "legends": [],
      "name": null,
      "orientation": "top_right",
      "plot": null,
      "tags": []
    },
    "id": "308dbfb0-ea22-4cf7-8134-afefa0d5f3bd",
    "type": "Legend"
  }
]