bokeh.models.glyphs

Models for display visual shapes whose attributes can be associated with data columns from data sources.

class AnnularWedge(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render annular wedges.

Example

source: tests/glyphs/AnnularWedge.py

direction

property type: Enum(‘clock’, ‘anticlock’)

Which direction to stroke between the start and end angles.

end_angle

property type: AngleSpec(‘end_angle’, units_default=’rad’)

The angles to end the annular wedges, in radians, as measured from the horizontal.

end_angle_units

property type: Enum(‘deg’, ‘rad’)

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the annular wedges.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the annular wedges.

inner_radius

property type: DistanceSpec(‘inner_radius’, units_default=’data’)

The inner radii of the annular wedges.

inner_radius_units

property type: Enum(‘screen’, ‘data’)

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the annular wedges.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the annular wedges.

line_color

property type: ColorSpec(‘black’)

The line color values for the annular wedges.

line_dash

property type: DashPattern

The line dash values for the annular wedges.

line_dash_offset

property type: Int

The line dash offset values for the annular wedges.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the annular wedges.

line_width

property type: NumberSpec(1)

The line width values for the annular wedges.

outer_radius

property type: DistanceSpec(‘outer_radius’, units_default=’data’)

The outer radii of the annular wedges.

outer_radius_units

property type: Enum(‘screen’, ‘data’)

start_angle

property type: AngleSpec(‘start_angle’, units_default=’rad’)

The angles to start the annular wedges, in radians, as measured from the horizontal.

start_angle_units

property type: Enum(‘deg’, ‘rad’)

x

property type: NumberSpec(‘x’)

The x-coordinates of the center of the annular wedges.

y

property type: NumberSpec(‘y’)

The y-coordinates of the center of the annular wedges.

[
  {
    "attributes": {
      "direction": "clock",
      "doc": null,
      "end_angle": {
        "field": "end_angle",
        "units": "rad"
      },
      "end_angle_units": "rad",
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "36fac81c-bd4e-4959-88fd-ac06df55762c",
      "inner_radius": {
        "field": "inner_radius",
        "units": "data"
      },
      "inner_radius_units": "data",
      "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,
      "outer_radius": {
        "field": "outer_radius",
        "units": "data"
      },
      "outer_radius_units": "data",
      "start_angle": {
        "field": "start_angle",
        "units": "rad"
      },
      "start_angle_units": "rad",
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "36fac81c-bd4e-4959-88fd-ac06df55762c",
    "type": "AnnularWedge"
  }
]
class Annulus(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render annuli.

Example

source: tests/glyphs/Annulus.py

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the annuli.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the annuli.

inner_radius

property type: DistanceSpec(‘inner_radius’, units_default=’data’)

The inner radii of the annuli.

inner_radius_units

property type: Enum(‘screen’, ‘data’)

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the annuli.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the annuli.

line_color

property type: ColorSpec(‘black’)

The line color values for the annuli.

line_dash

property type: DashPattern

The line dash values for the annuli.

line_dash_offset

property type: Int

The line dash offset values for the annuli.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the annuli.

line_width

property type: NumberSpec(1)

The line width values for the annuli.

outer_radius

property type: DistanceSpec(‘outer_radius’, units_default=’data’)

The outer radii of the annuli.

outer_radius_units

property type: Enum(‘screen’, ‘data’)

x

property type: NumberSpec(‘x’)

The x-coordinates of the center of the annuli.

y

property type: NumberSpec(‘y’)

The y-coordinates of the center of the annuli.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "7ab5eae0-1064-4ce6-a7f0-79a0f70460bd",
      "inner_radius": {
        "field": "inner_radius",
        "units": "data"
      },
      "inner_radius_units": "data",
      "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,
      "outer_radius": {
        "field": "outer_radius",
        "units": "data"
      },
      "outer_radius_units": "data",
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "7ab5eae0-1064-4ce6-a7f0-79a0f70460bd",
    "type": "Annulus"
  }
]
class Arc(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render arcs.

Example

source: tests/glyphs/Arc.py

direction

property type: Enum(‘clock’, ‘anticlock’)

Which direction to stroke between the start and end angles.

end_angle

property type: AngleSpec(‘end_angle’, units_default=’rad’)

The angles to end the arcs, in radians, as measured from the horizontal.

end_angle_units

property type: Enum(‘deg’, ‘rad’)

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the arcs.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the arcs.

line_color

property type: ColorSpec(‘black’)

The line color values for the arcs.

line_dash

property type: DashPattern

The line dash values for the arcs.

line_dash_offset

property type: Int

The line dash offset values for the arcs.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the arcs.

line_width

property type: NumberSpec(1)

The line width values for the arcs.

radius

property type: DistanceSpec(‘radius’, units_default=’data’)

Radius of the arc.

radius_units

property type: Enum(‘screen’, ‘data’)

start_angle

property type: AngleSpec(‘start_angle’, units_default=’rad’)

The angles to start the arcs, in radians, as measured from the horizontal.

start_angle_units

property type: Enum(‘deg’, ‘rad’)

x

property type: NumberSpec(‘x’)

The x-coordinates of the center of the arcs.

y

property type: NumberSpec(‘y’)

The y-coordinates of the center of the arcs.

[
  {
    "attributes": {
      "direction": "clock",
      "doc": null,
      "end_angle": {
        "field": "end_angle",
        "units": "rad"
      },
      "end_angle_units": "rad",
      "id": "35145f32-6f31-4fb5-96f2-2a64fb853c90",
      "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,
      "radius": {
        "field": "radius",
        "units": "data"
      },
      "radius_units": "data",
      "start_angle": {
        "field": "start_angle",
        "units": "rad"
      },
      "start_angle_units": "rad",
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "35145f32-6f31-4fb5-96f2-2a64fb853c90",
    "type": "Arc"
  }
]
class Bezier(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render Bézier curves.

For more information consult the Wikipedia article for Bézier curve.

Example

source: tests/glyphs/Bezier.py

cx0

property type: NumberSpec(‘cx0’)

The x-coordinates of first control points.

cx1

property type: NumberSpec(‘cx1’)

The x-coordinates of second control points.

cy0

property type: NumberSpec(‘cy0’)

The y-coordinates of first control points.

cy1

property type: NumberSpec(‘cy1’)

The y-coordinates of second control points.

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the Bézier curves.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the Bézier curves.

line_color

property type: ColorSpec(‘black’)

The line color values for the Bézier curves.

line_dash

property type: DashPattern

The line dash values for the Bézier curves.

line_dash_offset

property type: Int

The line dash offset values for the Bézier curves.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the Bézier curves.

line_width

property type: NumberSpec(1)

The line width values for the Bézier curves.

x0

property type: NumberSpec(‘x0’)

The x-coordinates of the starting points.

x1

property type: NumberSpec(‘x1’)

The x-coordinates of the ending points.

y0

property type: NumberSpec(‘y0’)

The y-coordinates of the starting points.

y1

property type: NumberSpec(‘y1’)

The y-coordinates of the ending points.

[
  {
    "attributes": {
      "cx0": {
        "field": "cx0"
      },
      "cx1": {
        "field": "cx1"
      },
      "cy0": {
        "field": "cy0"
      },
      "cy1": {
        "field": "cy1"
      },
      "doc": null,
      "id": "b7b7dc38-91df-4f8f-994b-addadd396ab5",
      "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,
      "tags": [],
      "visible": null,
      "x0": {
        "field": "x0"
      },
      "x1": {
        "field": "x1"
      },
      "y0": {
        "field": "y0"
      },
      "y1": {
        "field": "y1"
      }
    },
    "id": "b7b7dc38-91df-4f8f-994b-addadd396ab5",
    "type": "Bezier"
  }
]
class Gear(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render gears.

The details and nomenclature concerning gear construction can be quite involved. For more information, consult the Wikipedia article for Gear.

Example

source: tests/glyphs/Gear.py

angle

property type: AngleSpec(0, units_default=’rad’)

The angle the gears are rotated from horizontal. [rad]

angle_units

property type: Enum(‘deg’, ‘rad’)

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the gears.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the gears.

internal

property type: NumberSpec(False)

Whether the gear teeth are internal. [bool]

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the gears.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the gears.

line_color

property type: ColorSpec(‘black’)

The line color values for the gears.

line_dash

property type: DashPattern

The line dash values for the gears.

line_dash_offset

property type: Int

The line dash offset values for the gears.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the gears.

line_width

property type: NumberSpec(1)

The line width values for the gears.

module

property type: NumberSpec(‘module’)

A scaling factor, given by:

m = p / pi

where p is the circular pitch, defined as the distance from one face of a tooth to the corresponding face of an adjacent tooth on the same gear, measured along the pitch circle. [float]

pressure_angle

property type: NumberSpec(20)

The complement of the angle between the direction that the teeth exert force on each other, and the line joining the centers of the two gears. [deg]

shaft_size

property type: NumberSpec(0.3)

The central gear shaft size as a percentage of the overall gear size. [float]

teeth

property type: NumberSpec(‘teeth’)

How many teeth the gears have. [int]

x

property type: NumberSpec(‘x’)

The x-coordinates of the center of the gears.

y

property type: NumberSpec(‘y’)

The y-coordinates of the center of the gears.

[
  {
    "attributes": {
      "angle": {
        "units": "rad",
        "value": 0
      },
      "angle_units": "rad",
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "84192516-ca14-4a3e-b5f7-b85561060964",
      "internal": {
        "value": false
      },
      "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
      },
      "module": {
        "field": "module"
      },
      "name": null,
      "pressure_angle": {
        "value": 20
      },
      "shaft_size": {
        "value": 0.3
      },
      "tags": [],
      "teeth": {
        "field": "teeth"
      },
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "84192516-ca14-4a3e-b5f7-b85561060964",
    "type": "Gear"
  }
]
class Glyph(**kwargs)

Bases: bokeh.plot_object.PlotObject

Base class for all glyphs/marks/geoms/whatever-you-call-‘em in Bokeh.

visible

property type: Bool

Whether the glyph should render or not.

[
  {
    "attributes": {
      "doc": null,
      "id": "1c3dd68d-dd64-4765-866c-21f772ec50e2",
      "name": null,
      "tags": [],
      "visible": null
    },
    "id": "1c3dd68d-dd64-4765-866c-21f772ec50e2",
    "type": "Glyph"
  }
]
class Image(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render images given as scalar data together with a color mapper.

color_mapper

property type: Instance(Linear:class:~bokeh.properties.ColorMapper)

A ColorMapper to use to map the scalar data from image into RGBA values for display.

Note

The color mapping step happens on the client.

dh

property type: DistanceSpec(‘dh’, units_default=’data’)

The height of the plot region that the image will occupy.

Note

This is not the number of pixels that an image is tall. That number is fixed by the image itself.

dh_units

property type: Enum(‘screen’, ‘data’)

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the images bigger.

This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

dw

property type: DistanceSpec(‘dw’, units_default=’data’)

The widths of the plot regions that the images will occupy.

Note

This is not the number of pixels that an image is wide. That number is fixed by the image itself.

dw_units

property type: Enum(‘screen’, ‘data’)

image

property type: NumberSpec(‘image’)

The arrays of scalar data for the images to be colormapped.

x

property type: NumberSpec(‘x’)

The x-coordinates to locate the image anchors.

y

property type: NumberSpec(‘y’)

The y-coordinates to locate the image anchors.

[
  {
    "attributes": {
      "doc": null,
      "high": null,
      "id": "8eb0ce15-2c90-4144-8f3f-0abaa7314b72",
      "low": null,
      "name": null,
      "palette": [
        "#000000",
        "#252525",
        "#525252",
        "#737373",
        "#969696",
        "#bdbdbd",
        "#d9d9d9",
        "#f0f0f0",
        "#ffffff"
      ],
      "reserve_color": "#ffffff",
      "reserve_val": null,
      "tags": []
    },
    "id": "8eb0ce15-2c90-4144-8f3f-0abaa7314b72",
    "type": "LinearColorMapper"
  },
  {
    "attributes": {
      "color_mapper": {
        "id": "8eb0ce15-2c90-4144-8f3f-0abaa7314b72",
        "type": "LinearColorMapper"
      },
      "dh": {
        "field": "dh",
        "units": "data"
      },
      "dh_units": "data",
      "dilate": false,
      "doc": null,
      "dw": {
        "field": "dw",
        "units": "data"
      },
      "dw_units": "data",
      "id": "a1f1d02a-cee9-4dc3-a375-c929b5ecb1c0",
      "image": {
        "field": "image"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "a1f1d02a-cee9-4dc3-a375-c929b5ecb1c0",
    "type": "Image"
  }
]
class ImageRGBA(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render images given as RGBA data.

cols

property type: NumberSpec(‘cols’)

The numbers of columns in the images

dh

property type: DistanceSpec(‘dh’, units_default=’data’)

The height of the plot region that the image will occupy.

Note

This is not the number of pixels that an image is tall. That number is fixed by the image itself.

dh_units

property type: Enum(‘screen’, ‘data’)

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the images bigger.

This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

dw

property type: DistanceSpec(‘dw’, units_default=’data’)

The widths of the plot regions that the images will occupy.

Note

This is not the number of pixels that an image is wide. That number is fixed by the image itself.

dw_units

property type: Enum(‘screen’, ‘data’)

image

property type: NumberSpec(‘image’)

The arrays of RGBA data for the images.

rows

property type: NumberSpec(‘rows’)

The numbers of rows in the images

x

property type: NumberSpec(‘x’)

The x-coordinates to locate the image anchors.

y

property type: NumberSpec(‘y’)

The y-coordinates to locate the image anchors.

[
  {
    "attributes": {
      "cols": {
        "field": "cols"
      },
      "dh": {
        "field": "dh",
        "units": "data"
      },
      "dh_units": "data",
      "dilate": false,
      "doc": null,
      "dw": {
        "field": "dw",
        "units": "data"
      },
      "dw_units": "data",
      "id": "b56ff0cd-2f1b-471c-bc42-f0255b45de2b",
      "image": {
        "field": "image"
      },
      "name": null,
      "rows": {
        "field": "rows"
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "b56ff0cd-2f1b-471c-bc42-f0255b45de2b",
    "type": "ImageRGBA"
  }
]
class ImageURL(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render images loaded from given URLs.

Example

source: tests/glyphs/ImageURL.py

anchor

property type: Enum(‘top_left’, ‘top_center’, ‘top_right’, ‘right_center’, ‘bottom_right’, ‘bottom_center’, ‘bottom_left’, ‘left_center’, ‘center’)

What position of the image should be anchored at the x, y coordinates.

angle

property type: AngleSpec(0, units_default=’rad’)

The angles to rotate the images, in radians as measured from the horizontal.

angle_units

property type: Enum(‘deg’, ‘rad’)

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the images bigger.

This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

global_alpha

property type: Float

The opacity that each image is rendered with.

h

property type: DistanceSpec(‘h’, units_default=’data’)

The height of the plot region that the image will occupy.

Note

This is not the number of pixels that an image is tall. That number is fixed by the image itself.

Note

This may be renamed to “dh” in the future.

h_units

property type: Enum(‘screen’, ‘data’)

url

property type: NumberSpec(‘url’)

The URLs to retrieve images from.

Note

The actual retrieving and loading of the images happens on the client.

w

property type: DistanceSpec(‘w’, units_default=’data’)

The widths of the plot regions that the images will occupy.

Note

This is not the number of pixels that an image is wide. That number is fixed by the image itself.

Note

This may be renamed to “dw” in the future.

w_units

property type: Enum(‘screen’, ‘data’)

x

property type: NumberSpec(‘x’)

The x-coordinates to locate the image anchors.

y

property type: NumberSpec(‘y’)

The y-coordinates to locate the image anchors.

[
  {
    "attributes": {
      "anchor": "top_left",
      "angle": {
        "units": "rad",
        "value": 0
      },
      "angle_units": "rad",
      "dilate": false,
      "doc": null,
      "global_alpha": 1.0,
      "h": {
        "field": "h",
        "units": "data"
      },
      "h_units": "data",
      "id": "b39c8a10-f921-4c21-9eeb-140516ad5abe",
      "name": null,
      "tags": [],
      "url": {
        "field": "url"
      },
      "visible": null,
      "w": {
        "field": "w",
        "units": "data"
      },
      "w_units": "data",
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "b39c8a10-f921-4c21-9eeb-140516ad5abe",
    "type": "ImageURL"
  }
]
class Line(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render a single line.

Note

The Line glyph is different from most other glyphs in that the vector of values only produces one glyph on the Plot.

Example

source: tests/glyphs/Line.py

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the line.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the line.

line_color

property type: ColorSpec(‘black’)

The line color values for the line.

line_dash

property type: DashPattern

The line dash values for the line.

line_dash_offset

property type: Int

The line dash offset values for the line.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the line.

line_width

property type: NumberSpec(1)

The line width values for the line.

x

property type: NumberSpec(‘x’)

The x-coordinates for the points of the line.

y

property type: NumberSpec(‘y’)

The y-coordinates for the points of the line.

[
  {
    "attributes": {
      "doc": null,
      "id": "c09c3c4e-46a4-4328-8211-6d105c3f124e",
      "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,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "c09c3c4e-46a4-4328-8211-6d105c3f124e",
    "type": "Line"
  }
]
class MultiLine(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render several lines.

Note

The data for the MultiLine glyph is different in that the vector of values is not a vector of scalars. Rather, it is a “list of lists”.

Example

source: tests/glyphs/MultiLine.py

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the lines.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the lines.

line_color

property type: ColorSpec(‘black’)

The line color values for the lines.

line_dash

property type: DashPattern

The line dash values for the lines.

line_dash_offset

property type: Int

The line dash offset values for the lines.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the lines.

line_width

property type: NumberSpec(1)

The line width values for the lines.

xs

property type: NumberSpec(‘xs’)

The x-coordinates for all the lines, given as a “list of lists”.

ys

property type: NumberSpec(‘ys’)

The x-coordinates for all the lines, given as a “list of lists”.

[
  {
    "attributes": {
      "doc": null,
      "id": "da8a5893-4e89-47ea-8654-e1f44015fc59",
      "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,
      "tags": [],
      "visible": null,
      "xs": {
        "field": "xs"
      },
      "ys": {
        "field": "ys"
      }
    },
    "id": "da8a5893-4e89-47ea-8654-e1f44015fc59",
    "type": "MultiLine"
  }
]
class Oval(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render ovals.

Note

This glyph renders ovals using Bézier curves, which are similar, but not identical to ellipses.

Example

source: tests/glyphs/Oval.py

angle

property type: AngleSpec(‘angle’, units_default=’rad’)

The angle the ovals are rotated from horizontal. [rad]

angle_units

property type: Enum(‘deg’, ‘rad’)

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the ovals.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the ovals.

height

property type: DistanceSpec(‘height’, units_default=’data’)

The overall height of each oval.

height_units

property type: Enum(‘screen’, ‘data’)

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the ovals.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the ovals.

line_color

property type: ColorSpec(‘black’)

The line color values for the ovals.

line_dash

property type: DashPattern

The line dash values for the ovals.

line_dash_offset

property type: Int

The line dash offset values for the ovals.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the ovals.

line_width

property type: NumberSpec(1)

The line width values for the ovals.

width

property type: DistanceSpec(‘width’, units_default=’data’)

The overall widths of each oval.

width_units

property type: Enum(‘screen’, ‘data’)

x

property type: NumberSpec(‘x’)

The x-coordinates of the centers of the ovals.

y

property type: NumberSpec(‘y’)

The y-coordinates of the centers of the ovals.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "rad"
      },
      "angle_units": "rad",
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "height": {
        "field": "height",
        "units": "data"
      },
      "height_units": "data",
      "id": "49e38718-c1a9-4b28-8fe6-8804f5890042",
      "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,
      "tags": [],
      "visible": null,
      "width": {
        "field": "width",
        "units": "data"
      },
      "width_units": "data",
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "49e38718-c1a9-4b28-8fe6-8804f5890042",
    "type": "Oval"
  }
]
class Patch(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render a single patch.

Note

The Patch glyph is different from most other glyphs in that the vector of values only produces one glyph on the Plot.

Example

source: tests/glyphs/Patch.py

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the patch.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the patch.

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the patch.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the patch.

line_color

property type: ColorSpec(‘black’)

The line color values for the patch.

line_dash

property type: DashPattern

The line dash values for the patch.

line_dash_offset

property type: Int

The line dash offset values for the patch.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the patch.

line_width

property type: NumberSpec(1)

The line width values for the patch.

x

property type: NumberSpec(‘x’)

The x-coordinates for the points of the patch.

Note

A patch may comprise multiple polygons. In this case the x-coordinates for each polygon should be separated by NaN values in the sequence.

y

property type: NumberSpec(‘y’)

The y-coordinates for the points of the patch.

Note

A patch may comprise multiple polygons. In this case the y-coordinates for each polygon should be separated by NaN values in the sequence.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "fdc67719-a9b2-4920-987f-3e6ad8a18a03",
      "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,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "fdc67719-a9b2-4920-987f-3e6ad8a18a03",
    "type": "Patch"
  }
]
class Patches(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render several patches.

Note

The data for the Patches glyph is different in that the vector of values is not a vector of scalars. Rather, it is a “list of lists”.

Example

source: tests/glyphs/Patches.py

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the patches.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the patches.

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the patches.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the patches.

line_color

property type: ColorSpec(‘black’)

The line color values for the patches.

line_dash

property type: DashPattern

The line dash values for the patches.

line_dash_offset

property type: Int

The line dash offset values for the patches.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the patches.

line_width

property type: NumberSpec(1)

The line width values for the patches.

xs

property type: NumberSpec(‘xs’)

The x-coordinates for all the patches, given as a “list of lists”.

Note

Individual patches may comprise multiple polygons. In this case the x-coordinates for each polygon should be separated by NaN values in the sublists.

ys

property type: NumberSpec(‘ys’)

The y-coordinates for all the patches, given as a “list of lists”.

Note

Individual patches may comprise multiple polygons. In this case the y-coordinates for each polygon should be separated by NaN values in the sublists.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "a50244e2-0d08-4a02-bb0f-f3e13fa8314a",
      "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,
      "tags": [],
      "visible": null,
      "xs": {
        "field": "xs"
      },
      "ys": {
        "field": "ys"
      }
    },
    "id": "a50244e2-0d08-4a02-bb0f-f3e13fa8314a",
    "type": "Patches"
  }
]
class Quad(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render axis-aligned quads.

Example

source: tests/glyphs/Quad.py

bottom

property type: NumberSpec(‘bottom’)

The y-coordinates of the bottom edges.

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the quads.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the quads.

left

property type: NumberSpec(‘left’)

The x-coordinates of the left edges.

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the quads.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the quads.

line_color

property type: ColorSpec(‘black’)

The line color values for the quads.

line_dash

property type: DashPattern

The line dash values for the quads.

line_dash_offset

property type: Int

The line dash offset values for the quads.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the quads.

line_width

property type: NumberSpec(1)

The line width values for the quads.

right

property type: NumberSpec(‘right’)

The x-coordinates of the right edges.

top

property type: NumberSpec(‘top’)

The y-coordinates of the top edges.

[
  {
    "attributes": {
      "bottom": {
        "field": "bottom"
      },
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "06372d65-9173-4fbb-9d26-edf6ffc6cfe2",
      "left": {
        "field": "left"
      },
      "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,
      "right": {
        "field": "right"
      },
      "tags": [],
      "top": {
        "field": "top"
      },
      "visible": null
    },
    "id": "06372d65-9173-4fbb-9d26-edf6ffc6cfe2",
    "type": "Quad"
  }
]
class Quadratic(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render parabolas.

Example

source: tests/glyphs/Quadratic.py

cx

property type: NumberSpec(‘cx’)

The x-coordinates of the control points.

cy

property type: NumberSpec(‘cy’)

The y-coordinates of the control points.

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the parabolas.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the parabolas.

line_color

property type: ColorSpec(‘black’)

The line color values for the parabolas.

line_dash

property type: DashPattern

The line dash values for the parabolas.

line_dash_offset

property type: Int

The line dash offset values for the parabolas.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the parabolas.

line_width

property type: NumberSpec(1)

The line width values for the parabolas.

x0

property type: NumberSpec(‘x0’)

The x-coordinates of the starting points.

x1

property type: NumberSpec(‘x1’)

The x-coordinates of the ending points.

y0

property type: NumberSpec(‘y0’)

The y-coordinates of the starting points.

y1

property type: NumberSpec(‘y1’)

The y-coordinates of the ending points.

[
  {
    "attributes": {
      "cx": {
        "field": "cx"
      },
      "cy": {
        "field": "cy"
      },
      "doc": null,
      "id": "b360eb6f-f85a-41be-b01a-7e5609917f05",
      "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,
      "tags": [],
      "visible": null,
      "x0": {
        "field": "x0"
      },
      "x1": {
        "field": "x1"
      },
      "y0": {
        "field": "y0"
      },
      "y1": {
        "field": "y1"
      }
    },
    "id": "b360eb6f-f85a-41be-b01a-7e5609917f05",
    "type": "Quadratic"
  }
]
class Ray(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render rays.

Example

source: tests/glyphs/Ray.py

angle

property type: AngleSpec(‘angle’, units_default=’rad’)

The angles in radians to extend the rays, as measured from the horizontal.

angle_units

property type: Enum(‘deg’, ‘rad’)

length

property type: DistanceSpec(‘length’, units_default=’data’)

The length to extend the ray. Note that this length defaults to screen units.

length_units

property type: Enum(‘screen’, ‘data’)

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the rays.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the rays.

line_color

property type: ColorSpec(‘black’)

The line color values for the rays.

line_dash

property type: DashPattern

The line dash values for the rays.

line_dash_offset

property type: Int

The line dash offset values for the rays.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the rays.

line_width

property type: NumberSpec(1)

The line width values for the rays.

x

property type: NumberSpec(‘x’)

The x-coordinates to start the rays.

y

property type: NumberSpec(‘y’)

The y-coordinates to start the rays.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "rad"
      },
      "angle_units": "rad",
      "doc": null,
      "id": "ff6ee0c1-7f7d-4fbb-ad9b-eca230977953",
      "length": {
        "field": "length",
        "units": "data"
      },
      "length_units": "data",
      "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,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "ff6ee0c1-7f7d-4fbb-ad9b-eca230977953",
    "type": "Ray"
  }
]
class Rect(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render rectangles.

Example

source: tests/glyphs/Rect.py

angle

property type: AngleSpec(‘angle’, units_default=’rad’)

The angles to rotate the rectangles, in radians, as measured from the horizontal.

angle_units

property type: Enum(‘deg’, ‘rad’)

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the rectangles bigger.

This setting may be useful if pixel rounding errors are causing rectangles to have a gap between them, when they should appear flush.

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the rectangles.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the rectangles.

height

property type: DistanceSpec(‘height’, units_default=’data’)

The overall heights of the rectangles.

height_units

property type: Enum(‘screen’, ‘data’)

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the rectangles.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the rectangles.

line_color

property type: ColorSpec(‘black’)

The line color values for the rectangles.

line_dash

property type: DashPattern

The line dash values for the rectangles.

line_dash_offset

property type: Int

The line dash offset values for the rectangles.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the rectangles.

line_width

property type: NumberSpec(1)

The line width values for the rectangles.

width

property type: DistanceSpec(‘width’, units_default=’data’)

The overall widths of the rectangles.

width_units

property type: Enum(‘screen’, ‘data’)

x

property type: NumberSpec(‘x’)

The x-coordinates of the centers of the rectangles.

y

property type: NumberSpec(‘y’)

The y-coordinates of the centers of the rectangles.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "rad"
      },
      "angle_units": "rad",
      "dilate": false,
      "doc": null,
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "height": {
        "field": "height",
        "units": "data"
      },
      "height_units": "data",
      "id": "56aced15-28e6-4b96-bf61-3516fbc4ff81",
      "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,
      "tags": [],
      "visible": null,
      "width": {
        "field": "width",
        "units": "data"
      },
      "width_units": "data",
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "56aced15-28e6-4b96-bf61-3516fbc4ff81",
    "type": "Rect"
  }
]
class Segment(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render segments.

Example

source: tests/glyphs/Segment.py

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the segments.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the segments.

line_color

property type: ColorSpec(‘black’)

The line color values for the segments.

line_dash

property type: DashPattern

The line dash values for the segments.

line_dash_offset

property type: Int

The line dash offset values for the segments.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the segments.

line_width

property type: NumberSpec(1)

The line width values for the segments.

x0

property type: NumberSpec(‘x0’)

The x-coordinates of the starting points.

x1

property type: NumberSpec(‘x1’)

The x-coordinates of the ending points.

y0

property type: NumberSpec(‘y0’)

The y-coordinates of the starting points.

y1

property type: NumberSpec(‘y1’)

The y-coordinates of the ending points.

[
  {
    "attributes": {
      "doc": null,
      "id": "b7f76b33-a510-414d-8be5-540eb4ad4a77",
      "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,
      "tags": [],
      "visible": null,
      "x0": {
        "field": "x0"
      },
      "x1": {
        "field": "x1"
      },
      "y0": {
        "field": "y0"
      },
      "y1": {
        "field": "y1"
      }
    },
    "id": "b7f76b33-a510-414d-8be5-540eb4ad4a77",
    "type": "Segment"
  }
]
class Text(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render text.

Example

source: tests/glyphs/Text.py

angle

property type: AngleSpec(0, units_default=’rad’)

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

angle_units

property type: Enum(‘deg’, ‘rad’)

text

property type: StringSpec(‘text’)

The text values to render.

text_align

property type: Enum(‘left’, ‘right’, ‘center’)

The text align values for the text.

text_alpha

property type: NumberSpec(1.0)

The text alpha values for the text.

text_baseline

property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline values for the text.

text_color

property type: ColorSpec(‘#444444’)

The text color values for the text.

text_font

property type: String

The text font values for the text.

text_font_size

property type: FontSizeSpec(‘12pt’)

The text font size values for the text.

text_font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

The text font style values for the text.

x

property type: NumberSpec(‘x’)

The x-coordinates to locate the text anchors.

x_offset

property type: NumberSpec(0)

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.

y

property type: NumberSpec(‘y’)

The y-coordinates to locate the text anchors.

y_offset

property type: NumberSpec(0)

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.

[
  {
    "attributes": {
      "angle": {
        "units": "rad",
        "value": 0
      },
      "angle_units": "rad",
      "doc": null,
      "id": "3e97766e-fd2c-4691-bf42-83ce5e04a17b",
      "name": null,
      "tags": [],
      "text": {
        "field": "text"
      },
      "text_align": "left",
      "text_alpha": {
        "value": 1.0
      },
      "text_baseline": "bottom",
      "text_color": {
        "value": "#444444"
      },
      "text_font": "Helvetica",
      "text_font_size": {
        "field": "12pt"
      },
      "text_font_style": "normal",
      "visible": null,
      "x": {
        "field": "x"
      },
      "x_offset": {
        "value": 0
      },
      "y": {
        "field": "y"
      },
      "y_offset": {
        "value": 0
      }
    },
    "id": "3e97766e-fd2c-4691-bf42-83ce5e04a17b",
    "type": "Text"
  }
]
class Wedge(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render wedges.

Example

source: tests/glyphs/Wedge.py

direction

property type: Enum(‘clock’, ‘anticlock’)

Which direction to stroke between the start and end angles.

end_angle

property type: AngleSpec(‘end_angle’, units_default=’rad’)

The angles to end the wedges, in radians as measured from the horizontal.

end_angle_units

property type: Enum(‘deg’, ‘rad’)

fill_alpha

property type: NumberSpec(1.0)

The fill alpha values for the wedges.

fill_color

property type: ColorSpec(‘gray’)

The fill color values for the wedges.

line_alpha

property type: NumberSpec(1.0)

The line alpha values for the wedges.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the wedges.

line_color

property type: ColorSpec(‘black’)

The line color values for the wedges.

line_dash

property type: DashPattern

The line dash values for the wedges.

line_dash_offset

property type: Int

The line dash offset values for the wedges.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the wedges.

line_width

property type: NumberSpec(1)

The line width values for the wedges.

radius

property type: DistanceSpec(‘radius’, units_default=’data’)

Radii of the wedges.

radius_units

property type: Enum(‘screen’, ‘data’)

start_angle

property type: AngleSpec(‘start_angle’, units_default=’rad’)

The angles to start the wedges, in radians, as measured from the horizontal.

start_angle_units

property type: Enum(‘deg’, ‘rad’)

x

property type: NumberSpec(‘x’)

The x-coordinates of the points of the wedges.

y

property type: NumberSpec(‘y’)

The y-coordinates of the points of the wedges.

[
  {
    "attributes": {
      "direction": "clock",
      "doc": null,
      "end_angle": {
        "field": "end_angle",
        "units": "rad"
      },
      "end_angle_units": "rad",
      "fill_alpha": {
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "be3f54b9-038b-400b-918b-c1cd83ab52e8",
      "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,
      "radius": {
        "field": "radius",
        "units": "data"
      },
      "radius_units": "data",
      "start_angle": {
        "field": "start_angle",
        "units": "rad"
      },
      "start_angle_units": "rad",
      "tags": [],
      "visible": null,
      "x": {
        "field": "x"
      },
      "y": {
        "field": "y"
      }
    },
    "id": "be3f54b9-038b-400b-918b-c1cd83ab52e8",
    "type": "Wedge"
  }
]