bokeh.models.markers
¶Glyph renderer models for displaying simple scatter-type markers on Bokeh plots.
Asterisk
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render asterisk ‘*’ markers.
Example
source: tests/glyphs/Asterisk.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "4caf5719-aeb2-4f0e-b744-425402b11be7",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "4caf5719-aeb2-4f0e-b744-425402b11be7",
"type": "Asterisk"
}
]
Circle
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render circle markers.
Example
source: tests/glyphs/Circle.py
radius
¶property type: DistanceSpec
(‘radius’, units_default=’data’)
The radius values for circle markers. Interpreted 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 or size units are specified as “data”, the
“distance” for the radius is measured along the horizontal axis.
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: 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.
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "3ff1ccc3-90e3-4d24-978a-91cc4c85257c",
"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_dimension": "x",
"radius_units": "data",
"size": {
"units": "screen",
"value": 4
},
"tags": [],
"visible": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "3ff1ccc3-90e3-4d24-978a-91cc4c85257c",
"type": "Circle"
}
]
CircleCross
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render circle markers with a ‘+’ cross through the center.
Example
source: tests/glyphs/CircleCross.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "7d5fd2e6-b6e7-4aa7-a1a6-3af4e1965c09",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "7d5fd2e6-b6e7-4aa7-a1a6-3af4e1965c09",
"type": "CircleCross"
}
]
CircleX
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render circle markers with an ‘X’ cross through the center.
Example
source: tests/glyphs/CircleX.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "2d79ccdb-1019-4356-8eff-8abe5345eb65",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "2d79ccdb-1019-4356-8eff-8abe5345eb65",
"type": "CircleX"
}
]
Cross
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render ‘+’ cross markers.
Example
source: tests/glyphs/Cross.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "a2dd8d55-1005-4da1-89e3-2cf69c5555f9",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "a2dd8d55-1005-4da1-89e3-2cf69c5555f9",
"type": "Cross"
}
]
Diamond
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render diamond markers.
Example
source: tests/glyphs/Diamond.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "9641d9db-7271-4cc0-8441-3626456f2c25",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "9641d9db-7271-4cc0-8441-3626456f2c25",
"type": "Diamond"
}
]
DiamondCross
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render diamond markers with a ‘+’ cross through the center.
Example
source: tests/glyphs/DiamondCross.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "ffd84117-635f-40f0-a8f6-88dce4c3357f",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "ffd84117-635f-40f0-a8f6-88dce4c3357f",
"type": "DiamondCross"
}
]
InvertedTriangle
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render upside-down triangle markers.
Example
source: tests/glyphs/InvertedTriangle.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "8ba2f366-641d-4e59-9b41-48e91fa31a75",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "8ba2f366-641d-4e59-9b41-48e91fa31a75",
"type": "InvertedTriangle"
}
]
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: NumberSpec
(‘angle’)
The angles to rotate the markers.
fill_alpha
¶property type: NumberSpec
(1.0)
The fill alpha values for the markers.
fill_color
¶property type: ColorSpec
(‘gray’)
The fill color values for the markers.
line_alpha
¶property type: NumberSpec
(1.0)
The line alpha values for the markers.
line_color
¶property type: ColorSpec
(‘black’)
The line color values for the markers.
line_dash
¶property type: DashPattern
The line dash values for the markers.
line_width
¶property type: NumberSpec
(1)
The line width values for the markers.
size
¶property type: ScreenDistanceSpec
(4)
The size (diameter) values for the markers. Interpreted as “screen space” units by default.
x
¶property type: NumberSpec
(‘x’)
The x-axis coordinates for the center of the markers.
y
¶property type: NumberSpec
(‘y’)
The y-axis coordinates for the center of the markers.
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "2111fa8e-f21c-4ae9-a94d-175d0f843ec1",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "2111fa8e-f21c-4ae9-a94d-175d0f843ec1",
"type": "Marker"
}
]
Square
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render a square marker, optionally rotated.
Example
source: tests/glyphs/Square.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "82228ee3-a490-4804-a010-7d22b715a90a",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "82228ee3-a490-4804-a010-7d22b715a90a",
"type": "Square"
}
]
SquareCross
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render square markers with a ‘+’ cross through the center.
Example
source: tests/glyphs/SquareCross.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "fa70f10c-67dc-4c5d-8be9-999119ef016f",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "fa70f10c-67dc-4c5d-8be9-999119ef016f",
"type": "SquareCross"
}
]
SquareX
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render square markers with an ‘X’ cross through the center.
Example
source: tests/glyphs/SquareX.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "d6d65d4b-f44a-4972-8d5d-5eb2c1b41021",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "d6d65d4b-f44a-4972-8d5d-5eb2c1b41021",
"type": "SquareX"
}
]
Triangle
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render triangle markers.
Example
source: tests/glyphs/Triangle.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "053e28d1-eb57-42ec-a3d1-eca51afd1059",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "053e28d1-eb57-42ec-a3d1-eca51afd1059",
"type": "Triangle"
}
]
X
(**kwargs)¶Bases: bokeh.models.markers.Marker
Render a ‘X’ cross markers.
Example
source: tests/glyphs/X.py
[
{
"attributes": {
"angle": {
"field": "angle"
},
"doc": null,
"fill_alpha": {
"value": 1.0
},
"fill_color": {
"value": "gray"
},
"id": "fe16697c-cbbe-44a4-9460-610159a1bbf1",
"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": null,
"x": {
"field": "x"
},
"y": {
"field": "y"
}
},
"id": "fe16697c-cbbe-44a4-9460-610159a1bbf1",
"type": "X"
}
]