bokeh.models.markers

Glyph renderer models for displaying simple scatter-type markers on Bokeh plots.

class Asterisk(**kwargs)

Bases: bokeh.models.markers.Marker

Render asterisk ‘*’ markers.

Example

source: tests/glyphs/Asterisk.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "63dec0a8-00c7-478b-aa0c-599c56ae3fa4",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class Circle(**kwargs)

Bases: bokeh.models.markers.Marker

Render circle markers.

Example

source: tests/glyphs/Circle.py

radius

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

The radius values for circle markers (in “data space” units, by default).

Note

Circle markers are slightly unusual in that they support specifying a radius in addition to a size. Only one of radius or size should be given.

Warning

Note that Circle glyphs are always drawn as circles on the screen, even in cases where the data space aspect ratio is not 1-1. In all cases where radius values are specified, the “distance” for the radius is measured along the dimension specified by radius_dimension. If the aspect ratio is very large or small, the drawn circles may appear much larger or smaller than expected. See issue 626 for more information.

radius_dimension

property type: radius_dimension:Enum(‘x’, ‘y’)

What dimension to measure circle radii along.

When the data space aspect ratio is not 1-1, then the size of the drawn circles depends on what direction is used to measure the “distance” of the radius. This property allows that direction to be controlled.

radius_units

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

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "d55789fc-2add-44d3-84be-b1ce4fa9bdf0",
  "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": null,
  "radius_dimension": "x",
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class CircleCross(**kwargs)

Bases: bokeh.models.markers.Marker

Render circle markers with a ‘+’ cross through the center.

Example

source: tests/glyphs/CircleCross.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "836ae096-af14-4401-8152-8c907b2ddfe5",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class CircleX(**kwargs)

Bases: bokeh.models.markers.Marker

Render circle markers with an ‘X’ cross through the center.

Example

source: tests/glyphs/CircleX.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "08ab0d03-500f-49a0-be93-942b188d72fa",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class Cross(**kwargs)

Bases: bokeh.models.markers.Marker

Render ‘+’ cross markers.

Example

source: tests/glyphs/Cross.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "d90782bd-2164-4f3a-816d-db10b22ccea1",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class Diamond(**kwargs)

Bases: bokeh.models.markers.Marker

Render diamond markers.

Example

source: tests/glyphs/Diamond.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "61ee3949-d2d0-4006-8728-61b20f8eed92",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class DiamondCross(**kwargs)

Bases: bokeh.models.markers.Marker

Render diamond markers with a ‘+’ cross through the center.

Example

source: tests/glyphs/DiamondCross.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "ab12ea1e-a0bd-4d8a-8dcf-7e28be3faebf",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class InvertedTriangle(**kwargs)

Bases: bokeh.models.markers.Marker

Render upside-down triangle markers.

Example

source: tests/glyphs/InvertedTriangle.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "a03cd488-3a44-4432-8bf3-7ea10e6e4bcc",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class Marker(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Base class for glyphs that are simple markers with line and fill properties, located at an (x, y) location with a specified size.

Note

For simplicity, all markers have both line and fill properties declared, however some markers (Asterisk, Cross, X) only draw lines. For these markers, the fill values are simply ignored.

angle

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

The angles to rotate the markers.

angle_units

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

fill_alpha

property type: fill_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The fill alpha values for the markers.

fill_color

property type: fill_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The fill color values for the markers.

line_alpha

property type: line_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line alpha values for the markers.

line_cap

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

The line cap values for the markers.

line_color

property type: line_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The line color values for the markers.

line_dash

property type: line_dash:DashPattern

The line dash values for the markers.

line_dash_offset

property type: line_dash_offset:Int

The line dash offset values for the markers.

line_join

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

The line join values for the markers.

line_width

property type: line_width:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line width values for the markers.

size

property type: size:ScreenDistanceSpec(String, Dict(String, Either(String, Float)), Float)

The size (diameter) values for the markers in screen space units.

x

property type: x:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The x-axis coordinates for the center of the markers.

y

property type: y:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The y-axis coordinates for the center of the markers.

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "f7dd4b0b-dc71-4787-bdf7-22f66ca1b991",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class Square(**kwargs)

Bases: bokeh.models.markers.Marker

Render a square marker, optionally rotated.

Example

source: tests/glyphs/Square.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "0eb6dbb5-8f45-4c2f-a69d-c5e94f53444d",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class SquareCross(**kwargs)

Bases: bokeh.models.markers.Marker

Render square markers with a ‘+’ cross through the center.

Example

source: tests/glyphs/SquareCross.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "d22eded5-231f-4542-b1ad-f7573c4aebd2",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class SquareX(**kwargs)

Bases: bokeh.models.markers.Marker

Render square markers with an ‘X’ cross through the center.

Example

source: tests/glyphs/SquareX.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "be8d6044-01d1-4831-9d0e-fc80fdb92811",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class Triangle(**kwargs)

Bases: bokeh.models.markers.Marker

Render triangle markers.

Example

source: tests/glyphs/Triangle.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "6bf5cfa1-0c74-48ac-820c-d02118bc7fc0",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}
class X(**kwargs)

Bases: bokeh.models.markers.Marker

Render a ‘X’ cross markers.

Example

source: tests/glyphs/X.py

JSON Prototype
{
  "angle": {
    "units": "rad",
    "value": 0.0
  },
  "fill_alpha": {
    "value": 1.0
  },
  "fill_color": {
    "value": "gray"
  },
  "id": "d2498a8b-59dd-4442-b7e9-641445286a73",
  "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,
  "size": {
    "units": "screen",
    "value": 4
  },
  "tags": [],
  "visible": true,
  "x": null,
  "y": null
}