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": "68cbe00d-300f-499d-b75f-6e1b0216f3fb",
  "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": "2e19bd31-c37c-47b0-b469-2cd9497e4574",
  "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": "a431e2a0-77a3-42a1-a2f8-a58a16d92358",
  "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": "7af29507-a23f-4f34-9f96-264a0fac3b01",
  "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": "a06c6b49-c4b3-4d5a-8e33-57df5007dff2",
  "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": "8b497865-91cd-41ce-a029-5b50bc34efd5",
  "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": "7bcc69e8-40b3-48b4-8635-a195a24df841",
  "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": "975b6e29-abc5-4d21-a365-66b66ff6fd38",
  "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, Instance(Transform), Instance(ColorMapper), Float)), Float)

The fill alpha values for the markers.

fill_color

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

The fill color values for the markers.

line_alpha

property type: line_alpha:NumberSpec(String, Dict(String, Either(String, Instance(Transform), Instance(ColorMapper), 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, Instance(Transform), Instance(ColorMapper), 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, Instance(Transform), Instance(ColorMapper), Float)), Float)

The line width values for the markers.

size

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

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

x

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

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

y

property type: y:NumberSpec(String, Dict(String, Either(String, Instance(Transform), Instance(ColorMapper), 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": "1b4648e2-af9f-4276-a1ee-d9e406be6d12",
  "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": "88963beb-5775-42a7-b759-1e0d6b0cd54e",
  "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": "0cedccc1-5450-4dcb-a0a2-40431a0b60d9",
  "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": "dc89e48d-35ee-4009-8778-2a990db8ee09",
  "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": "70efed7f-2bc7-455a-a8b0-288d81285555",
  "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": "34e3375b-bee0-474f-ad94-ae016a913a85",
  "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
}