bokeh.models.markers

Display a variety of simple scatter marker shapes whose attributes can be associated with data columns from ColumnDataSource objects.

Note

The individual marker classes in this module are deprecated since Bokeh 2.3.0. Please replace all occurrences of Marker models with Scatter glyphs. For example: instead of Asterisk(), use Scatter(marker="asterisk").

For backwards compatibility, all markers in this module currently link to their respective replacements using the Scatter glyph.

The full list of markers accessible through this module:

By definition, all markers accept the following set of properties:

  • x, y position

  • size in pixels

  • line, fill, and hatch properties

  • angle

The asterisk, cross, dash`, ``dot, x, and y are rendered as lines. Therefore, those markers ignore any values that are passed to the fill and hatch properties.

Note

When you draw circle markers with Scatter, you can only assign a size in screen units (by passing a number of pixels to the size argument). In case you want to define the radius of circles in data units, use the Circle glyph instead of the Scatter glyph with a circle marker.

class Marker(*args, **kwargs)[source]

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 marker types (asterisk, cross, x) only draw lines. For these markers, the fill values are simply ignored.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

angle
Property type

AngleSpec

Default value

0.0

The angles to rotate the markers.

fill_alpha
Property type

AlphaSpec

Default value

1.0

The fill alpha values for the markers.

fill_color
Property type

ColorSpec

Default value

'gray'

The fill color values for the markers.

hatch_alpha
Property type

AlphaSpec

Default value

1.0

The hatch alpha values for the markers.

hatch_color
Property type

ColorSpec

Default value

'black'

The hatch color values for the markers.

hatch_extra
Property type

Dict(String, Instance(Texture))

Default value

{}

The hatch extra values for the markers.

hatch_pattern
Property type

HatchPatternSpec

Default value

None

The hatch pattern values for the markers.

hatch_scale
Property type

NumberSpec

Default value

12.0

The hatch scale values for the markers.

hatch_weight
Property type

NumberSpec

Default value

1.0

The hatch weight values for the markers.

hit_dilation
Property type

Size

Default value

1.0

The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools.

line_alpha
Property type

AlphaSpec

Default value

1.0

The line alpha values for the markers.

line_cap
Property type

LineCapSpec

Default value

'butt'

The line cap values for the markers.

line_color
Property type

ColorSpec

Default value

'black'

The line color values for the markers.

line_dash
Property type

DashPatternSpec

Default value

[]

The line dash values for the markers.

line_dash_offset
Property type

IntSpec

Default value

0

The line dash offset values for the markers.

line_join
Property type

LineJoinSpec

Default value

'bevel'

The line join values for the markers.

line_width
Property type

NumberSpec

Default value

1

The line width values for the markers.

size
Property type

ScreenDistanceSpec

Default value

4

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

x
Property type

NumberSpec

Default value

{'field': 'x'}

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

y
Property type

NumberSpec

Default value

{'field': 'y'}

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