figure#

class figure(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Bases: Plot, GlyphAPI

Create a new figure for plotting.

A subclass of Plot that simplifies plot creation with default axes, grids, tools, etc.

Figure objects have many glyph methods that can be used to draw vectorized graphical glyphs:

There is a scatter function that can be parameterized by marker type:

There are also specialized methods for stacking bars:

As well as one specialized method for making simple hexbin plots:

In addition to all the figure property attributes, the following options are also accepted:

Keyword Arguments:
above = []#
Type:

List

A list of renderers to occupy the area above of the plot.

align = 'auto'#
Type:

Either(Auto, Enum(Align), Tuple(Enum(Align), Enum(Align)))

The alignment point within the parent container.

This property is useful only if this component is a child element of a layout (e.g. a grid). Self alignment can be overridden by the parent container (e.g. grid track align).

aspect_ratio = None#
Type:

Either(Null, Auto, Float)

Describes the proportional relationship between component’s width and height.

This works if any of component’s dimensions are flexible in size. If set to a number, width / height = aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

aspect_scale = 1#
Type:

Float

A value to be given for increased aspect ratio control. This value is added multiplicatively to the calculated value required for match_aspect. aspect_scale is defined as the ratio of width over height of the figure.

For example, a plot with aspect_scale value of 2 will result in a square in data units to be drawn on the screen as a rectangle with a pixel width twice as long as its pixel height.

Note

This setting only takes effect if match_aspect is set to True.

background_fill_alpha = 1.0#
Type:

Alpha

The fill alpha for the plot background style.

background_fill_color = '#ffffff'#
Type:

Nullable(Color)

The fill color for the plot background style.

below = []#
Type:

List

A list of renderers to occupy the area below of the plot.

border_fill_alpha = 1.0#
Type:

Alpha

The fill alpha for the plot border style.

border_fill_color = '#ffffff'#
Type:

Nullable(Color)

The fill color for the plot border style.

center = []#
Type:

List

A list of renderers to occupy the center area (frame) of the plot.

context_menu = None#
Type:

Nullable(Instance(Menu))

A menu to display when user right clicks on the component.

Note

To display a native context menu, the viewer will need to right-click twice. The second click closes the Bokeh context menu and falls back back the native one.

css_classes = []#
Type:

List

A list of additional CSS classes to add to the underlying DOM element.

disabled = False#
Type:

Bool

Whether the widget will be disabled when rendered.

If True, the widget will be greyed-out and not responsive to UI events.

extra_x_ranges = {}#
Type:

Dict(String, Instance(Range))

Additional named ranges to make available for mapping x-coordinates.

This is useful for adding additional axes.

extra_x_scales = {}#
Type:

Dict(String, Instance(Scale))

Additional named scales to make available for mapping x-coordinates.

This is useful for adding additional axes.

Note

This feature is experimental and may change in the short term.

extra_y_ranges = {}#
Type:

Dict(String, Instance(Range))

Additional named ranges to make available for mapping y-coordinates.

This is useful for adding additional axes.

extra_y_scales = {}#
Type:

Dict(String, Instance(Scale))

Additional named scales to make available for mapping y-coordinates.

This is useful for adding additional axes.

Note

This feature is experimental and may change in the short term.

flow_mode = 'block'#
Type:

Enum(FlowMode)

Defines whether the layout will flow in the block or inline dimension.

frame_align = True#
Type:

Either(Bool, Struct)

Allows to specify which frame edges to align in multiple-plot layouts.

The default is to align all edges, but users can opt-out from alignment of each individual edge or all edges. Note also that other proproperties may disable alignment of certain edges, especially when using fixed frame size (frame_width and frame_height properties).

frame_height = None#
Type:

Nullable(Int)

The height of a plot frame or the inner height of a plot, excluding any axes, titles, border padding, etc.

frame_width = None#
Type:

Nullable(Int)

The width of a plot frame or the inner width of a plot, excluding any axes, titles, border padding, etc.

height = 600#
Type:

Nullable(NonNegative)

The height of the component (in pixels).

This can be either fixed or preferred height, depending on height sizing policy.

height_policy = 'auto'#
Type:

Either(Auto, Enum(SizingPolicy))

Describes how the component should maintain its height.

"auto"

Use component’s preferred sizing policy.

"fixed"

Use exactly height pixels. Component will overflow if it can’t fit in the available vertical space.

"fit"

Use component’s preferred height (if set) and allow to fit into the available vertical space within the minimum and maximum height bounds (if set). Component’s height neither will be aggressively minimized nor maximized.

"min"

Use as little vertical space as possible, not less than the minimum height (if set). The starting point is the preferred height (if set). The height of the component may shrink or grow depending on the parent layout, aspect management and other factors.

"max"

Use as much vertical space as possible, not more than the maximum height (if set). The starting point is the preferred height (if set). The height of the component may shrink or grow depending on the parent layout, aspect management and other factors.

Note

This is an experimental feature and may change in future. Use it at your own discretion. Prefer using sizing_mode if this level of control isn’t strictly necessary.

hidpi = True#
Type:

Bool

Whether to use HiDPI mode when available.

hold_render = False#
Type:

Bool

When set to True all requests to repaint the plot will be hold off.

This is useful when periodically updating many glyphs. For example, let’s assume we have 10 lines on a plot, each with its own datasource. We stream to all of them every second in a for loop like so:

for line in lines:
    line.stream(new_points())

The problem with this code is that every stream triggers a re-rendering of the plot. Even tough repainting only on the last stream would produce almost identical visual effect. Especially for lines with many points this becomes computationally expensive and can freeze your browser. Using a convenience method hold, we can control when rendering is initiated like so:

with plot.hold(render=True):
    for line in lines:
        line.stream(new_points())

In this case we render newly appended points only after the last stream.

inner_height = Undefined#
Type:

Readonly

This is the exact height of the plotting canvas, i.e. the height of the actual plot, without toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).

Note

This is an experimental feature and the API may change in near future.

inner_width = Undefined#
Type:

Readonly

This is the exact width of the plotting canvas, i.e. the width of the actual plot, without toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).

Note

This is an experimental feature and the API may change in near future.

left = []#
Type:

List

A list of renderers to occupy the area to the left of the plot.

lod_factor = 10#
Type:

Int

Decimation factor to use when applying level-of-detail decimation.

lod_interval = 300#
Type:

Int

Interval (in ms) during which an interactive tool event will enable level-of-detail downsampling.

lod_threshold = 2000#
Type:

Nullable(Int)

A number of data points, above which level-of-detail downsampling may be performed by glyph renderers. Set to None to disable any level-of-detail downsampling.

lod_timeout = 500#
Type:

Int

Timeout (in ms) for checking whether interactive tool events are still occurring. Once level-of-detail mode is enabled, a check is made every lod_timeout ms. If no interactive tool events have happened, level-of-detail mode is disabled.

margin = None#
Type:

Nullable(Either(Int, Tuple(Int, Int), Tuple(Int, Int, Int, Int)))

Allows to create additional space around the component. The values in the tuple are ordered as follows - Margin-Top, Margin-Right, Margin-Bottom and Margin-Left, similar to CSS standards. Negative margin values may be used to shrink the space from any direction.

match_aspect = False#
Type:

Bool

Specify the aspect ratio behavior of the plot. Aspect ratio is defined as the ratio of width over height. This property controls whether Bokeh should attempt to match the (width/height) of data space to the (width/height) in pixels of screen space.

Default is False which indicates that the data aspect ratio and the screen aspect ratio vary independently. True indicates that the plot aspect ratio of the axes will match the aspect ratio of the pixel extent the axes. The end result is that a 1x1 area in data space is a square in pixels, and conversely that a 1x1 pixel is a square in data units.

Note

This setting only takes effect when there are two dataranges. This setting only sets the initial plot draw and subsequent resets. It is possible for tools (single axis zoom, unconstrained box zoom) to change the aspect ratio.

Warning

This setting is incompatible with linking dataranges across multiple plots. Doing so may result in undefined behavior.

max_height = None#
Type:

Nullable(NonNegative)

Maximal height of the component (in pixels) if height is adjustable.

max_width = None#
Type:

Nullable(NonNegative)

Maximal width of the component (in pixels) if width is adjustable.

min_border = 5#
Type:

Nullable(Int)

A convenience property to set all all the min_border_X properties to the same value. If an individual border property is explicitly set, it will override min_border.

min_border_bottom = None#
Type:

Nullable(Int)

Minimum size in pixels of the padding region below the bottom of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_border_left = None#
Type:

Nullable(Int)

Minimum size in pixels of the padding region to the left of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_border_right = None#
Type:

Nullable(Int)

Minimum size in pixels of the padding region to the right of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_border_top = None#
Type:

Nullable(Int)

Minimum size in pixels of the padding region above the top of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_height = None#
Type:

Nullable(NonNegative)

Minimal height of the component (in pixels) if height is adjustable.

min_width = None#
Type:

Nullable(NonNegative)

Minimal width of the component (in pixels) if width is adjustable.

name = None#
Type:

Nullable(String)

An arbitrary, user-supplied name for this model.

This name can be useful when querying the document to retrieve specific Bokeh models.

>>> plot.circle([1,2,3], [4,5,6], name="temp")
>>> plot.select(name="temp")
[GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]

Note

No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

outer_height = Undefined#
Type:

Readonly

This is the exact height of the layout, i.e. the height of the actual plot, with toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).

Note

This is an experimental feature and the API may change in near future.

outer_width = Undefined#
Type:

Readonly

This is the exact width of the layout, i.e. the height of the actual plot, with toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).

Note

This is an experimental feature and the API may change in near future.

outline_line_alpha = 1.0#
Type:

Alpha

The line alpha for the plot border outline.

outline_line_cap = 'butt'#
Type:

Enum(LineCap)

The line cap for the plot border outline.

outline_line_color = '#e5e5e5'#
Type:

Nullable(Color)

The line color for the plot border outline.

outline_line_dash = []#
Type:

DashPattern

The line dash for the plot border outline.

outline_line_dash_offset = 0#
Type:

Int

The line dash offset for the plot border outline.

outline_line_join = 'bevel'#
Type:

Enum(LineJoin)

The line join for the plot border outline.

outline_line_width = 1#
Type:

Float

The line width for the plot border outline.

output_backend = 'canvas'#
Type:

Enum(OutputBackend)

Specify the output backend for the plot area. Default is HTML5 Canvas.

Note

When set to webgl, glyphs without a WebGL rendering implementation will fall back to rendering onto 2D canvas.

renderers = []#
Type:

List

A list of all glyph renderers for this plot.

This property can be manipulated by hand, but the add_glyph is recommended to help make sure all necessary setup is performed.

reset_policy = 'standard'#
Type:

Enum(ResetPolicy)

How a plot should respond to being reset. By deafult, the standard actions are to clear any tool state history, return plot ranges to their original values, undo all selections, and emit a Reset event. If customization is desired, this property may be set to "event_only", which will suppress all of the actions except the Reset event.

resizable = False#
Type:

Either(Bool, Enum(Dimensions))

Whether the layout is interactively resizable, and if so in which dimensions.

right = []#
Type:

List

A list of renderers to occupy the area to the right of the plot.

sizing_mode = None#
Type:

Nullable(Enum(SizingMode))

How the component should size itself.

This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode).

Possible scenarios:

"inherit"

The sizing mode is inherited from the parent layout. If there is no parent layout (or parent is not a layout), then this value is treated as if no value for sizing_mode was provided.

"fixed"

Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events.

"stretch_width"

Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents.

"stretch_height"

Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents.

"stretch_both"

Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component.

"scale_width"

Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio.

"scale_height"

Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio.

"scale_both"

Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

styles = {}#
Type:

Either(Dict(String, Nullable(String)), Instance(Styles))

Inline CSS styles applied to the underlying DOM element.

stylesheets = []#
Type:

List

Additional style-sheets to use for the underlying DOM element.

Note that all bokeh’s components use shadow DOM, thus any included style sheets must reflect that, e.g. use :host CSS pseudo selector to access the root DOM element.

syncable = True#
Type:

Bool

Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

Note

Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work.

tags = []#
Type:

List

An optional list of arbitrary, user-supplied values to attach to this model.

This data can be useful when querying the document to retrieve specific Bokeh models:

>>> r = plot.circle([1,2,3], [4,5,6])
>>> r.tags = ["foo", 10]
>>> plot.select(tags=['foo', 10])
[GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]

Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

Note

No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason.

title = Title(id='p61192', ...)#
Type:

Either(Null, Instance(Title))

A title for the plot. Can be a text string or a Title annotation.

title_location = 'above'#
Type:

Nullable(Enum(Location))

Where the title will be located. Titles on the left or right side will be rotated.

toolbar = Toolbar(id='p61249', ...)#
Type:

Instance(Toolbar)

The toolbar associated with this plot which holds all the tools. It is automatically created with the plot if necessary.

toolbar_inner = False#
Type:

Bool

Locate the toolbar inside the frame. Setting this property to True makes most sense with auto-hidden toolbars.

toolbar_location = 'right'#
Type:

Nullable(Enum(Location))

Where the toolbar will be located. If set to None, no toolbar will be attached to the plot.

toolbar_sticky = True#
Type:

Bool

Stick the toolbar to the edge of the plot. Default: True. If False, the toolbar will be outside of the axes, titles etc.

visible = True#
Type:

Bool

Whether the component should be displayed on screen.

width = 600#
Type:

Nullable(NonNegative)

The width of the component (in pixels).

This can be either fixed or preferred width, depending on width sizing policy.

width_policy = 'auto'#
Type:

Either(Auto, Enum(SizingPolicy))

Describes how the component should maintain its width.

"auto"

Use component’s preferred sizing policy.

"fixed"

Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space.

"fit"

Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized.

"min"

Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

"max"

Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

Note

This is an experimental feature and may change in future. Use it at your own discretion. Prefer using sizing_mode if this level of control isn’t strictly necessary.

x_range = DataRange1d(id='p61446', ...)#
Type:

Instance(Range)

The (default) data range of the horizontal dimension of the plot.

x_scale = LinearScale(id='p61475', ...)#
Type:

Instance(Scale)

What kind of scale to use to convert x-coordinates in data space into x-coordinates in screen space.

y_range = DataRange1d(id='p61504', ...)#
Type:

Instance(Range)

The (default) data range of the vertical dimension of the plot.

y_scale = LinearScale(id='p61533', ...)#
Type:

Instance(Scale)

What kind of scale to use to convert y-coordinates in data space into y-coordinates in screen space.

add_glyph(source_or_glyph: Glyph | ColumnarDataSource, glyph: Glyph | None = None, **kwargs: Any) GlyphRenderer#

Adds a glyph to the plot with associated data sources and ranges.

This function will take care of creating and configuring a Glyph object, and then add it to the plot’s list of renderers.

Parameters:
  • source (DataSource) – a data source for the glyphs to all use

  • glyph (Glyph) – the glyph to add to the Plot

Keyword Arguments:
  • the (Any additional keyword arguments are passed on as-is to) –

  • initializer. (Glyph) –

Returns:

GlyphRenderer

add_layout(obj: Renderer, place: Literal['above', 'below', 'left', 'right', 'center'] = 'center') None#

Adds an object to the plot in a specified place.

Parameters:
  • obj (Renderer) – the object to add to the Plot

  • place (str, optional) – where to add the object (default: ‘center’) Valid places are: ‘left’, ‘right’, ‘above’, ‘below’, ‘center’.

Returns:

None

add_tile(tile_source: TileSource | xyzservices.TileProvider | str, retina: bool = False, **kwargs: Any) TileRenderer#

Adds new TileRenderer into Plot.renderers

Parameters:
Keyword Arguments:

renderer (Additional keyword arguments are passed on as-is to the tile) –

Returns:

TileRenderer

Return type:

TileRenderer

add_tools(*tools: Tool | str) None#

Adds tools to the plot.

Parameters:

*tools (Tool) – the tools to add to the Plot

Returns:

None

annular_wedge(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), inner_radius=Field(field='inner_radius', transform=Unspecified, units=Unspecified), outer_radius=Field(field='outer_radius', transform=Unspecified, units=Unspecified), start_angle=Field(field='start_angle', transform=Unspecified, units=Unspecified), end_angle=Field(field='end_angle', transform=Unspecified, units=Unspecified), direction='anticlock', *, decorations=[], end_angle_units='rad', fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, inner_radius_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, outer_radius_units='data', start_angle_units='rad', syncable=True, tags=[], **kwargs)#

Configure and add AnnularWedge glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-coordinates of the center of the annular wedges. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates of the center of the annular wedges. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • inner_radius (DistanceSpec, optional) – The inner radii of the annular wedges. (default: Field(field=’inner_radius’, transform=Unspecified, units=Unspecified))

  • outer_radius (DistanceSpec, optional) – The outer radii of the annular wedges. (default: Field(field=’outer_radius’, transform=Unspecified, units=Unspecified))

  • start_angle (AngleSpec, optional) – The angles to start the annular wedges, as measured from the horizontal. (default: Field(field=’start_angle’, transform=Unspecified, units=Unspecified))

  • end_angle (AngleSpec, optional) – The angles to end the annular wedges, as measured from the horizontal. (default: Field(field=’end_angle’, transform=Unspecified, units=Unspecified))

  • direction (Enum(Direction), optional) – Which direction to stroke between the start and end angles. (default: ‘anticlock’)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • end_angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the annular wedges. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the annular wedges. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the annular wedges. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the annular wedges. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the annular wedges. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the annular wedges.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the annular wedges. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the annular wedges. (default: 1.0)

  • inner_radius_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the annular wedges. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the annular wedges. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the annular wedges. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the annular wedges. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the annular wedges. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the annular wedges. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the annular wedges. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • outer_radius_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • start_angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

annulus(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), inner_radius=Field(field='inner_radius', transform=Unspecified, units=Unspecified), outer_radius=Field(field='outer_radius', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, inner_radius_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, outer_radius_units='data', syncable=True, tags=[], **kwargs)#

Configure and add Annulus glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-coordinates of the center of the annuli. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates of the center of the annuli. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • inner_radius (DistanceSpec, optional) – The inner radii of the annuli. (default: Field(field=’inner_radius’, transform=Unspecified, units=Unspecified))

  • outer_radius (DistanceSpec, optional) – The outer radii of the annuli. (default: Field(field=’outer_radius’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the annuli. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the annuli. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the annuli. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the annuli. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the annuli. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the annuli.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the annuli. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the annuli. (default: 1.0)

  • inner_radius_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the annuli. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the annuli. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the annuli. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the annuli. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the annuli. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the annuli. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the annuli. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • outer_radius_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.annulus(x=[1, 2, 3], y=[1, 2, 3], color="#7FC97F",
             inner_radius=0.2, outer_radius=0.5)

show(plot)
apply_theme(property_values: dict[str, Any]) None#

Apply a set of theme values which will be used rather than defaults, but will not override application-set values.

The passed-in dictionary may be kept around as-is and shared with other instances to save memory (so neither the caller nor the HasProps instance should modify it).

Parameters:

property_values (dict) – theme values to use in place of defaults

Returns:

None

arc(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), radius=Field(field='radius', transform=Unspecified, units=Unspecified), start_angle=Field(field='start_angle', transform=Unspecified, units=Unspecified), end_angle=Field(field='end_angle', transform=Unspecified, units=Unspecified), direction='anticlock', *, decorations=[], end_angle_units='rad', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, radius_units='data', start_angle_units='rad', syncable=True, tags=[], **kwargs)#

Configure and add Arc glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-coordinates of the center of the arcs. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates of the center of the arcs. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • radius (DistanceSpec, optional) – Radius of the arc. (default: Field(field=’radius’, transform=Unspecified, units=Unspecified))

  • start_angle (AngleSpec, optional) – The angles to start the arcs, as measured from the horizontal. (default: Field(field=’start_angle’, transform=Unspecified, units=Unspecified))

  • end_angle (AngleSpec, optional) – The angles to end the arcs, as measured from the horizontal. (default: Field(field=’end_angle’, transform=Unspecified, units=Unspecified))

  • direction (Enum(Direction), optional) – Which direction to stroke between the start and end angles. (default: ‘anticlock’)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • end_angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the arcs. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the arcs. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the arcs. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the arcs. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the arcs. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the arcs. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the arcs. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • radius_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • start_angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

asterisk(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.asterisk(x=[1,2,3], y=[1,2,3], size=20, color="#F0027F")

show(plot)
bezier(x0=Field(field='x0', transform=Unspecified, units=Unspecified), y0=Field(field='y0', transform=Unspecified, units=Unspecified), x1=Field(field='x1', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), cx0=Field(field='cx0', transform=Unspecified, units=Unspecified), cy0=Field(field='cy0', transform=Unspecified, units=Unspecified), cx1=Field(field='cx1', transform=Unspecified, units=Unspecified), cy1=Field(field='cy1', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Bezier glyphs to this figure.

Parameters:
  • x0 (NumberSpec, optional) – The x-coordinates of the starting points. (default: Field(field=’x0’, transform=Unspecified, units=Unspecified))

  • y0 (NumberSpec, optional) – The y-coordinates of the starting points. (default: Field(field=’y0’, transform=Unspecified, units=Unspecified))

  • x1 (NumberSpec, optional) – The x-coordinates of the ending points. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))

  • y1 (NumberSpec, optional) – The y-coordinates of the ending points. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))

  • cx0 (NumberSpec, optional) – The x-coordinates of first control points. (default: Field(field=’cx0’, transform=Unspecified, units=Unspecified))

  • cy0 (NumberSpec, optional) – The y-coordinates of first control points. (default: Field(field=’cy0’, transform=Unspecified, units=Unspecified))

  • cx1 (NumberSpec, optional) – The x-coordinates of second control points. (default: Field(field=’cx1’, transform=Unspecified, units=Unspecified))

  • cy1 (NumberSpec, optional) – The y-coordinates of second control points. (default: Field(field=’cy1’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • line_alpha (AlphaSpec, optional) – The line alpha values for the Bezier curves. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the Bezier curves. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the Bezier curves. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the Bezier curves. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the Bezier curves. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the Bezier curves. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the Bezier curves. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

block(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), width=1, height=1, *, border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Block glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-coordinates of the centers of the blocks. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates of the centers of the blocks. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • width (NumberSpec, optional) – The widths of the blocks. (default: 1)

  • height (NumberSpec, optional) – The heights of the blocks. (default: 1)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • border_radius (Either(NonNegative, Struct)) –

    Allows the box to have rounded corners.

    Note

    This property is experimental and may change at any point. (default: 0)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the blocks. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the blocks. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the blocks. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the blocks. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the blocks. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the blocks.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the blocks. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the blocks. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the blocks. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the blocks. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the blocks. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the blocks. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the blocks. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the blocks. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the blocks. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.block(x=[1, 2, 3], y=[1,2,3], width=0.5, height=1, , color="#CAB2D6")

show(plot)
circle(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, angle=0.0, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, radius=None, radius_dimension='x', radius_units='data', size=4, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • radius (NullDistanceSpec) –

    The radius values for circle markers (in data 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 #626 for more information.

  • radius_dimension (Enum(Enumeration(x, y, max, min)), optional) –

    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.

    Setting this dimension to ‘max’ will calculate the radius on both the x and y dimensions and use the maximum of the two, ‘min’ selects the minimum. (default: ‘x’)

  • radius_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Note

Only one of size or radius should be provided. Note that radius defaults to data units.

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.circle(x=[1, 2, 3], y=[1, 2, 3], size=20)

show(plot)
circle_cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.circle_cross(x=[1,2,3], y=[4,5,6], size=20,
                  color="#FB8072", fill_alpha=0.2, line_width=2)

show(plot)
circle_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.circle_dot(x=[1,2,3], y=[4,5,6], size=20,
                color="#FB8072", fill_color=None)

show(plot)
circle_x(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.circle_x(x=[1, 2, 3], y=[1, 2, 3], size=20,
              color="#DD1C77", fill_alpha=0.2)

show(plot)
circle_y(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.circle_y(x=[1, 2, 3], y=[1, 2, 3], size=20,
              color="#DD1C77", fill_alpha=0.2)

show(plot)
clone() HasProps#

Duplicate a HasProps object.

This creates a shallow clone of the original model, i.e. any mutable containers or child models will not be duplicated.

column(col, gridplot)#

Return whether this plot is in a given column of a GridPlot.

Parameters:
  • col (int) – index of the column to test

  • gridplot (GridPlot) – the GridPlot to check

Returns:

bool

contour(x: ArrayLike | None = None, y: ArrayLike | None = None, z: ArrayLike | np.ma.MaskedArray | None = None, levels: ArrayLike | None = None, **visuals) ContourRenderer[source]#

Creates a contour plot of filled polygons and/or contour lines.

Filled contour polygons are calculated if fill_color is set, contour lines if line_color is set.

Parameters:
  • x (array-like[float] of shape (ny, nx) or (nx,), optional) – The x-coordinates of the z values. May be 2D with the same shape as z.shape, or 1D with length nx = z.shape[1]. If not specified are assumed to be np.arange(nx). Must be ordered monotonically.

  • y (array-like[float] of shape (ny, nx) or (ny,), optional) – The y-coordinates of the z values. May be 2D with the same shape as z.shape, or 1D with length ny = z.shape[0]. If not specified are assumed to be np.arange(ny). Must be ordered monotonically.

  • z (array-like[float] of shape (ny, nx)) – A 2D NumPy array of gridded values to calculate the contours of. May be a masked array, and any invalid values (np.inf or np.nan) will also be masked out.

  • levels (array-like[float]) – The z-levels to calculate the contours at, must be increasing. Contour lines are calculated at each level and filled contours are calculated between each adjacent pair of levels so the number of sets of contour lines is len(levels) and the number of sets of filled contour polygons is len(levels)-1.

  • **visuals

    fill properties, hatch properties and line properties Fill and hatch properties are used for filled contours, line properties for line contours. If using vectorized properties then the correct number must be used, len(levels) for line properties and len(levels)-1 for fill and hatch properties.

    fill_color and line_color are more flexible in that they will accept longer sequences and interpolate them to the required number using linear_palette(), and also accept palette collections (dictionaries mapping from integer length to color sequence) such as bokeh.palettes.Cividis.

cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.cross(x=[1, 2, 3], y=[1, 2, 3], size=20,
           color="#E6550D", line_width=2)

show(plot)
dash(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.dash(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
          color="#99D594", line_width=2)

show(plot)
classmethod dataspecs() dict[str, DataSpec]#

Collect the names of all DataSpec properties on this class.

This method always traverses the class hierarchy and includes properties defined on any parent classes.

Returns:

names of DataSpec properties

Return type:

set[str]

classmethod descriptors() list[bokeh.core.property.descriptors.PropertyDescriptor[Any]]#

List of property descriptors in the order of definition.

destroy() None#

Clean up references to the document and property

diamond(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.diamond(x=[1, 2, 3], y=[1, 2, 3], size=20,
             color="#1C9099", line_width=2)

show(plot)
diamond_cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.diamond_cross(x=[1, 2, 3], y=[1, 2, 3], size=20,
                   color="#386CB0", fill_color=None, line_width=2)

show(plot)
diamond_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.diamond_dot(x=[1, 2, 3], y=[1, 2, 3], size=20,
                 color="#386CB0", fill_color=None)

show(plot)
dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.dot(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#386CB0")

show(plot)
ellipse(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), width=Field(field='width', transform=Unspecified, units=Unspecified), height=Field(field='height', transform=Unspecified, units=Unspecified), angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, height_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], width_units='data', **kwargs)#

Configure and add Ellipse glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-coordinates of the centers of the ellipses. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates of the centers of the ellipses. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • width (DistanceSpec, optional) – The widths of each ellipse. (default: Field(field=’width’, transform=Unspecified, units=Unspecified))

  • height (DistanceSpec, optional) – The heights of each ellipse. (default: Field(field=’height’, transform=Unspecified, units=Unspecified))

  • angle (AngleSpec) – The angle the ellipses are rotated from horizontal. [rad] (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the ellipses. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the ellipses. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the ellipses. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the ellipses. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the ellipses. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the ellipses.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the ellipses. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the ellipses. (default: 1.0)

  • height_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the ellipses. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the ellipses. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the ellipses. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the ellipses. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the ellipses. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the ellipses. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the ellipses. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

  • width_units (NotSerialized(Enum(SpatialUnits)), optional) – Units to use for the associated property: screen or data (default: ‘data’)

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.ellipse(x=[1, 2, 3], y=[1, 2, 3], width=30, height=20,
             color="#386CB0", fill_color=None, line_width=2)

show(plot)
equals(other: HasProps) bool#

Structural equality of models.

Parameters:

other (HasProps) – the other instance to compare to

Returns:

True, if properties are structurally equal, otherwise False

graph(node_source, edge_source, layout_provider, **kwargs)[source]#

Creates a network graph using the given node, edge and layout provider.

Parameters:
  • node_source (ColumnDataSource) – a user-supplied data source for the graph nodes. An attempt will be made to convert the object to ColumnDataSource if needed. If none is supplied, one is created for the user automatically.

  • edge_source (ColumnDataSource) – a user-supplied data source for the graph edges. An attempt will be made to convert the object to ColumnDataSource if needed. If none is supplied, one is created for the user automatically.

  • layout_provider (LayoutProvider) – a LayoutProvider instance to provide the graph coordinates in Cartesian space.

  • **kwargsline properties and fill properties

harea(x1=Field(field='x1', transform=Unspecified, units=Unspecified), x2=Field(field='x2', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, name=None, syncable=True, tags=[], **kwargs)#

Configure and add HArea glyphs to this figure.

Parameters:
  • x1 (NumberSpec, optional) – The x-coordinates for the points of one side of the area. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))

  • x2 (NumberSpec, optional) – The x-coordinates for the points of the other side of the area. (default: Field(field=’x2’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates for the points of the area. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (Alpha, optional) – The fill alpha values for the horizontal directed area. (default: 1.0)

  • fill_color (Nullable(Color), optional) – The fill color values for the horizontal directed area. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the horizontal directed area. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the horizontal directed area. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the horizontal directed area. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the horizontal directed area.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the horizontal directed area. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the horizontal directed area. (default: 1.0)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.harea(x1=[0, 0, 0], x2=[1, 4, 2], y=[1, 2, 3],
           fill_color="#99D594")

show(plot)
harea_stack(stackers, **kw)[source]#

Generate multiple HArea renderers for levels stacked left to right.

Parameters:

stackers (seq[str]) –

a list of data source field names to stack successively for x1 and x2 harea coordinates.

Additionally, the name of the renderer will be set to the value of each successive stacker (this is useful with the special hover variable $name)

Any additional keyword arguments are passed to each call to harea. If a keyword value is a list or tuple, then each call will get one value from the sequence.

Returns:

list[GlyphRenderer]

Examples

Assuming a ColumnDataSource named source with columns 2016 and 2017, then the following call to harea_stack will will create two HArea renderers that stack:

p.harea_stack(['2016', '2017'], y='y', color=['blue', 'red'], source=source)

This is equivalent to the following two separate calls:

p.harea(x1=stack(),       x2=stack('2016'),         y='y', color='blue', source=source, name='2016')
p.harea(x1=stack('2016'), x2=stack('2016', '2017'), y='y', color='red',  source=source, name='2017')
harea_step(x1=Field(field='x1', transform=Unspecified, units=Unspecified), x2=Field(field='x2', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, name=None, step_mode='before', syncable=True, tags=[], **kwargs)#

Configure and add HAreaStep glyphs to this figure.

Parameters:
  • x1 (NumberSpec, optional) – The x-coordinates for the points of one side of the area. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))

  • x2 (NumberSpec, optional) – The x-coordinates for the points of the other side of the area. (default: Field(field=’x2’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates for the points of the area. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (Alpha, optional) – The fill alpha values for the horizontal directed area. (default: 1.0)

  • fill_color (Nullable(Color), optional) – The fill color values for the horizontal directed area. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the horizontal directed area. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the horizontal directed area. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the horizontal directed area. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the horizontal directed area.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the horizontal directed area. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the horizontal directed area. (default: 1.0)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • step_mode (Enum(StepMode), optional) –

    Where the step “level” should be drawn in relation to the x and y coordinates. The parameter can assume one of three values:

    • before: (default) Draw step levels before each y-coordinate (no step before the first point)

    • after: Draw step levels after each y-coordinate (no step after the last point)

    • center: Draw step levels centered on each y-coordinate (default: ‘before’)

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.harea_step(x1=[1, 2, 3], x2=[0, 0, 0], y=[1, 4, 2],
                step_mode="after", fill_color="#99D594")

show(plot)
hbar(y=Field(field='y', transform=Unspecified, units=Unspecified), height=1, right=Field(field='right', transform=Unspecified, units=Unspecified), left=0, *, border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add HBar glyphs to this figure.

Parameters:
  • y (NumberSpec, optional) – The y-coordinates of the centers of the horizontal bars. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • height (NumberSpec, optional) – The heights of the vertical bars. (default: 1)

  • right (NumberSpec, optional) – The x-coordinates of the right edges. (default: Field(field=’right’, transform=Unspecified, units=Unspecified))

  • left (NumberSpec) – The x-coordinates of the left edges. (default: 0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • border_radius (Either(NonNegative, Struct)) –

    Allows the box to have rounded corners.

    Note

    This property is experimental and may change at any point. (default: 0)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the horizontal bars. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the horizontal bars. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the horizontal bars. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the horizontal bars. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the horizontal bars. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the horizontal bars.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the horizontal bars. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the horizontal bars. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the horizontal bars. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the horizontal bars. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the horizontal bars. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the horizontal bars. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the horizontal bars. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the horizontal bars. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the horizontal bars. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.hbar(y=[1, 2, 3], height=0.5, left=0, right=[1,2,3], color="#CAB2D6")

show(plot)
hbar_stack(stackers, **kw)[source]#

Generate multiple HBar renderers for levels stacked left to right.

Parameters:

stackers (seq[str]) –

a list of data source field names to stack successively for left and right bar coordinates.

Additionally, the name of the renderer will be set to the value of each successive stacker (this is useful with the special hover variable $name)

Any additional keyword arguments are passed to each call to hbar. If a keyword value is a list or tuple, then each call will get one value from the sequence.

Returns:

list[GlyphRenderer]

Examples

Assuming a ColumnDataSource named source with columns 2016 and 2017, then the following call to hbar_stack will will create two HBar renderers that stack:

p.hbar_stack(['2016', '2017'], y=10, width=0.9, color=['blue', 'red'], source=source)

This is equivalent to the following two separate calls:

p.hbar(bottom=stack(),       top=stack('2016'),         y=10, width=0.9, color='blue', source=source, name='2016')
p.hbar(bottom=stack('2016'), top=stack('2016', '2017'), y=10, width=0.9, color='red',  source=source, name='2017')
hex(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.hex(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1")

show(plot)
hex_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add Scatter glyphs to this figure.

Parameters:
  • x (NumberSpec, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • size (SizeSpec, optional) – The size (diameter) values for the markers in screen space units. (default: 4)

  • angle (AngleSpec) – The angles to rotate the markers. (default: 0.0)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • angle_units (NotSerialized(Enum(AngleUnits)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the markers. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the markers. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the markers. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the markers. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the markers.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the markers. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the markers. (default: 1.0)

  • hit_dilation (Size, optional) – 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. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the markers. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the markers. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the markers. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the markers. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the markers. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the markers. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the markers. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300)
plot.hex_dot(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30],
             color="#74ADD1", fill_color=None)

show(plot)
hex_tile(q=Field(field='q', transform=Unspecified, units=Unspecified), r=Field(field='r', transform=Unspecified, units=Unspecified), *, aspect_scale=1.0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color=None, line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, orientation='pointytop', scale=1.0, size=1.0, syncable=True, tags=[], **kwargs)#

Configure and add HexTile glyphs to this figure.

Parameters:
  • q (NumberSpec, optional) – The “column” axial coordinates of the tile centers. (default: Field(field=’q’, transform=Unspecified, units=Unspecified))

  • r (NumberSpec, optional) – The “row” axial coordinates of the tile centers. (default: Field(field=’r’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • aspect_scale (Float, optional) –

    Match a plot’s aspect ratio scaling.

    Use this parameter to match the aspect ratio scaling of a plot when using aspect_scale with a value other than 1.0. (default: 1.0)

  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the hex tiles. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the hex tiles. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the hex tiles. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the hex tiles. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the hex tiles. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the hex tiles.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the hex tiles. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the hex tiles. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the hex tiles. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the hex tiles. (default: ‘butt’)

  • line_color (ColorSpec) – The line color values for the hex tiles.

  • line_dash (DashPatternSpec) – The line dash values for the hex tiles. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the hex tiles. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the hex tiles. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the hex tiles. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • orientation (String, optional) –

    The orientation of the hex tiles.

    Use "pointytop" to orient the tile so that a pointed corner is at the top. Use "flattop" to orient the tile so that a flat side is at the top. (default: ‘pointytop’)

  • scale (NumberSpec, optional) – A scale factor for individual tiles. (default: 1.0)

  • size (Float, optional) –

    The radius (in data units) of the hex tiling.

    The radius is always measured along the cartesian y-axis for “pointy_top” orientation, and along the cartesian x-axis for “flat_top” orientation. If the aspect ratio of the underlying cartesian system is not 1-1, then the tiles may be “squished” in one direction. To ensure that the tiles are always regular hexagons, consider setting the match_aspect property of the plot to True. (default: 1.0)

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300, match_aspect=True)
plot.hex_tile(r=[0, 0, 1], q=[1, 2, 2], fill_color="#74ADD1")

show(plot)
hexbin(x, y, size, orientation='pointytop', palette='Viridis256', line_color=None, fill_color=None, aspect_scale=1, **kwargs)[source]#

Perform a simple equal-weight hexagonal binning.

A HexTile glyph will be added to display the binning. The ColumnDataSource for the glyph will have columns q, r, and count, where q and r are axial coordinates for a tile, and count is the associated bin count.

It is often useful to set match_aspect=True on the associated plot, so that hexagonal tiles are all regular (i.e. not “stretched”) in screen space.

For more sophisticated use-cases, e.g. weighted binning or individually scaling hex tiles, use hex_tile() directly, or consider a higher level library such as HoloViews.

Parameters:
  • x (array[float]) – A NumPy array of x-coordinates to bin into hexagonal tiles.

  • y (array[float]) – A NumPy array of y-coordinates to bin into hexagonal tiles.

  • size (float) –

    The size of the hexagonal tiling to use. The size is defined as distance from the center of a hexagon to a corner.

    In case the aspect scaling is not 1-1, then specifically size is the distance from the center to the “top” corner with the “pointytop” orientation, and the distance from the center to a “side” corner with the “flattop” orientation.

  • orientation ("pointytop" or "flattop", optional) – Whether the hexagonal tiles should be oriented with a pointed corner on top, or a flat side on top. (default: “pointytop”)

  • palette (str or seq[color], optional) –

    A palette (or palette name) to use to colormap the bins according to count. (default: ‘Viridis256’)

    If fill_color is supplied, it overrides this value.

  • line_color (color, optional) – The outline color for hex tiles, or None (default: None)

  • fill_color (color, optional) – An optional fill color for hex tiles, or None. If None, then the palette will be used to color map the tiles by count. (default: None)

  • aspect_scale (float) –

    Match a plot’s aspect ratio scaling.

    When working with a plot with aspect_scale != 1, this parameter can be set to match the plot, in order to draw regular hexagons (instead of “stretched” ones).

    This is roughly equivalent to binning in “screen space”, and it may be better to use axis-aligned rectangular bins when plot aspect scales are not one.

Any additional keyword arguments are passed to hex_tile().

Returns:

(Glyphrender, DataFrame)

A tuple with the HexTile renderer generated to display the binning, and a Pandas DataFrame with columns q, r, and count, where q and r are axial coordinates for a tile, and count is the associated bin count.

Example

import numpy as np
from bokeh.models import HoverTool
from bokeh.plotting import figure, show

x = 2 + 2*np.random.standard_normal(500)
y = 2 + 2*np.random.standard_normal(500)

p = figure(match_aspect=True, tools="wheel_zoom,reset")
p.background_fill_color = '#440154'
p.grid.visible = False

p.hexbin(x, y, size=0.5, hover_color="pink", hover_alpha=0.8)

hover = HoverTool(tooltips=[("count", "@c"), ("(q,r)", "(@q, @r)")])
p.add_tools(hover)

show(p)
hline_stack(stackers, **kw)[source]#

Generate multiple Line renderers for lines stacked horizontally.

Parameters:

stackers (seq[str]) – a list of data source field names to stack successively for x line coordinates.

Additionally, the name of the renderer will be set to the value of each successive stacker (this is useful with the special hover variable $name)

Any additional keyword arguments are passed to each call to line. If a keyword value is a list or tuple, then each call will get one value from the sequence.

Returns:

list[GlyphRenderer]

Examples

Assuming a ColumnDataSource named source with columns 2016 and 2017, then the following call to hline_stack with stackers for the x-coordinates will will create two Line renderers that stack:

p.hline_stack(['2016', '2017'], y='y', color=['blue', 'red'], source=source)

This is equivalent to the following two separate calls:

p.line(x=stack('2016'),         y='y', color='blue', source=source, name='2016')
p.line(x=stack('2016', '2017'), y='y', color='red',  source=source, name='2017')
hold(*, render: bool) Generator[None, None, None]#

Takes care of turning a property on and off within a scope.

Parameters:

render (bool) – Turns the property hold_render on and off.

hspan(y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add HSpan glyphs to this figure.

Parameters:
  • y (NumberSpec, optional) – The y-coordinates of the spans. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • line_alpha (AlphaSpec, optional) – The line alpha values for the spans. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the spans. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the spans. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the spans. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the spans. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the spans. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the spans. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300, x_range=(0, 1))
plot.hspan(y=[1, 2, 3], color="#CAB2D6")

show(plot)
hstrip(y0=Field(field='y0', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#

Configure and add HStrip glyphs to this figure.

Parameters:
  • y0 (NumberSpec, optional) – The y-coordinates of the coordinates of one side of the strips. (default: Field(field=’y0’, transform=Unspecified, units=Unspecified))

  • y1 (NumberSpec, optional) – The y-coordinates of the coordinates of the other side of the strips. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.

  • source (ColumnDataSource, optional) –

    A user-supplied data source. (defatult: None)

    If not supplied, Bokeh will automatically construct an internal ColumnDataSource with default column names from the coordinates and other arguments that were passed-in as literal list or array values.

    If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g. x=10) or column names in the data source (e.g. x="time") are permitted.

  • view (CDSView, optional) – A view for filtering the data source. (default: None)

  • visible (bool, optional) – Whether the glyph should be rendered. (default: True)

  • x_range_name (str, optional) –

    The name of an extra range to use for mapping x-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • y_range_name (str, optional) –

    The name of an extra range to use for mapping y-coordinates. (default: None)

    If not supplied, then the default y_range of the plot will be used for coordinate mapping.

  • level (RenderLevel, optional) – Specify the render level order for this glyph.

Keyword Arguments:
  • decorations (List) –

    A collection of glyph decorations, e.g. arrow heads.

    Use GlyphRenderer.add_decoration() for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.

    Note

    Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])

  • fill_alpha (AlphaSpec, optional) – The fill alpha values for the strips. (default: 1.0)

  • fill_color (ColorSpec, optional) – The fill color values for the strips. (default: ‘gray’)

  • hatch_alpha (AlphaSpec, optional) – The hatch alpha values for the strips. (default: 1.0)

  • hatch_color (ColorSpec, optional) – The hatch color values for the strips. (default: ‘black’)

  • hatch_extra (Dict(String, Instance(‘bokeh.models.textures.Texture’))) – The hatch extra values for the strips. (default: {})

  • hatch_pattern (HatchPatternSpec) – The hatch pattern values for the strips.

  • hatch_scale (NumberSpec, optional) – The hatch scale values for the strips. (default: 12.0)

  • hatch_weight (NumberSpec, optional) – The hatch weight values for the strips. (default: 1.0)

  • line_alpha (AlphaSpec, optional) – The line alpha values for the strips. (default: 1.0)

  • line_cap (LineCapSpec, optional) – The line cap values for the strips. (default: ‘butt’)

  • line_color (ColorSpec, optional) – The line color values for the strips. (default: ‘black’)

  • line_dash (DashPatternSpec) – The line dash values for the strips. (default: [])

  • line_dash_offset (IntSpec) – The line dash offset values for the strips. (default: 0)

  • line_join (LineJoinSpec, optional) – The line join values for the strips. (default: ‘bevel’)

  • line_width (NumberSpec, optional) – The line width values for the strips. (default: 1)

  • name (Nullable(String)) –

    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific Bokeh models.

    >>> plot.circle([1,2,3], [4,5,6], name="temp")
    >>> plot.select(name="temp")
    [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
    

    Note

    No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.

  • syncable (Bool, optional) –

    Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to False may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.

    Note

    Setting this property to False will prevent any on_change() callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)

  • tags (List) –

    An optional list of arbitrary, user-supplied values to attach to this model.

    This data can be useful when querying the document to retrieve specific Bokeh models:

    >>> r = plot.circle([1,2,3], [4,5,6])
    >>> r.tags = ["foo", 10]
    >>> plot.select(tags=['foo', 10])
    [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
    

    Or simply a convenient way to attach any necessary metadata to a model that can be accessed by CustomJS callbacks, etc.

    Note

    No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])

It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass nonselection_alpha to set the line and fill alpha for nonselect, or hover_fill_alpha to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.

Returns:

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(width=300, height=300, x_range=(0, 1))
plot.hstrip(y0=[1, 2, 5], y1=[3, 4, 8], color="#CAB2D6")

show(plot)
image(image=Field(field='image', transform=Unspecified, units=Unspecified), x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), dw=Field(field='dw', transform=Unspecified, units=Unspecified), dh=Field(field='dh', transform=Unspecified, units=Unspecified), dilate=False, *, anchor='bottom_left', color_mapper=<Instance: LinearColorMapper(palette=Greys9)>, decorations=[], dh_units='data', dw_units='data', global_alpha=1.0, name=None, origin='bottom_left', palette, syncable=True, tags=[], **kwargs)#

Configure and add Image glyphs to this figure.

Parameters:
  • image (NumberSpec, optional) – The arrays of scalar data for the images to be colormapped. (default: Field(field=’image’, transform=Unspecified, units=Unspecified))

  • x (NumberSpec, optional) – The x-coordinates to locate the image anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))

  • y (NumberSpec, optional) – The y-coordinates to locate the image anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))

  • dw (DistanceSpec, optional) –

    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. (default: Field(field=’dw’, transform=Unspecified, units=Unspecified))

  • dh (DistanceSpec, optional) –

    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. (default: Field(field=’dh’, transform=Unspecified, units=Unspecified))

  • dilate (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. (default: False)

  • alpha (float, optional) –

    An alias to set all alpha keyword arguments at once. (default: None)

    Alpha values must be between 0 (fully transparent) and 1 (fully opaque).

    Any explicitly set values for line_alpha, etc. will override this setting.

  • color (color, optional) –

    An alias to set all color keyword arguments at once. (default: None)

    See Color properties in the user guide for different options to define colors.

    Any explicitly set values for line_color, etc. will override this setting.

  • legend_field (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_group (str, optional) –

    Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.

    The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied

  • legend_label (str, optional) –

    Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.

    Note

    Only one of legend_field, legend_group, or legend_label should be supplied.

  • muted (bool, optionall) –

    Whether the glyph should be rendered as muted (default: False)

    For this to be useful, an muted_glyph must be configured on the returned GlyphRender. This can be done by explicitly creating a Glyph to use, or more simply by passing e.g. muted_color, etc. to this glyph function.

  • name (str, optional) –

    An optional user-supplied name to attach to the renderer (default: None)

    Bokeh does not use this value in any way, but it may be useful for searching