bokeh.plotting

figure(**kwargs)[source]

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 Args:

active_drag (Either ( Auto , String , Instance ( Drag ) ))

Which drag tool should initially be active. (default: ‘auto’)

active_inspect (Either ( Auto , String , Instance ( Inspection ), Seq ( Instance ( Inspection ) ) ))

Which drag tool should initially be active. (default: ‘auto’)

active_scroll (Either ( Auto , String , Instance ( Scroll ) ))

Which scroll tool should initially be active. (default: ‘auto’)

active_tap (Either ( Auto , String , Instance ( Tap ) ))

Which tap tool should initially be active. (default: ‘auto’)

tools (Either ( String , Seq ( Either ( String , Instance ( Tool ) ) ) ))

Tools the plot should start with. (default: ‘pan,wheel_zoom,box_zoom,save,reset,help’)

tooltips (Either ( String , List ( Tuple ( String , String ) ) ))

An optional argument to configure tooltips for the Figure. This argument accepts the same values as the HoverTool.tooltips property. If a hover tool is specified in the tools argument, this value will override that hover tools tooltips value. If no hover tool is specified in the tools argument, then passing tooltips here will cause one to be created and added. (default: None)

x_axis_label (String )

A label for the x-axis. (default: ‘’)

x_axis_location (Enum ( VerticalLocation ))

Where the x-axis should be located. (default: ‘below’)

x_axis_type (Either ( Auto , Enum ( Enumeration(linear, log, datetime, mercator) ) ))

The type of the x-axis. (default: ‘auto’)

x_minor_ticks (Either ( Auto , Int ))

Number of minor ticks between adjacent x-axis major ticks. (default: ‘auto’)

x_range (Any )

Customize the x-range of the plot. (default: None)

y_axis_label (String )

A label for the y-axis. (default: ‘’)

y_axis_location (Enum ( HorizontalLocation ))

Where the y-axis should be located. (default: ‘left’)

y_axis_type (Either ( Auto , Enum ( Enumeration(linear, log, datetime, mercator) ) ))

The type of the y-axis. (default: ‘auto’)

y_minor_ticks (Either ( Auto , Int ))

Number of minor ticks between adjacent y-axis major ticks. (default: ‘auto’)

y_range (Any )

Customize the y-range of the plot. (default: None)

class Figure(*arg, **kw)[source]

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 Args:

active_drag (Either ( Auto , String , Instance ( Drag ) ))

Which drag tool should initially be active. (default: ‘auto’)

active_inspect (Either ( Auto , String , Instance ( Inspection ), Seq ( Instance ( Inspection ) ) ))

Which drag tool should initially be active. (default: ‘auto’)

active_scroll (Either ( Auto , String , Instance ( Scroll ) ))

Which scroll tool should initially be active. (default: ‘auto’)

active_tap (Either ( Auto , String , Instance ( Tap ) ))

Which tap tool should initially be active. (default: ‘auto’)

tools (Either ( String , Seq ( Either ( String , Instance ( Tool ) ) ) ))

Tools the plot should start with. (default: ‘pan,wheel_zoom,box_zoom,save,reset,help’)

tooltips (Either ( String , List ( Tuple ( String , String ) ) ))

An optional argument to configure tooltips for the Figure. This argument accepts the same values as the HoverTool.tooltips property. If a hover tool is specified in the tools argument, this value will override that hover tools tooltips value. If no hover tool is specified in the tools argument, then passing tooltips here will cause one to be created and added. (default: None)

x_axis_label (String )

A label for the x-axis. (default: ‘’)

x_axis_location (Enum ( VerticalLocation ))

Where the x-axis should be located. (default: ‘below’)

x_axis_type (Either ( Auto , Enum ( Enumeration(linear, log, datetime, mercator) ) ))

The type of the x-axis. (default: ‘auto’)

x_minor_ticks (Either ( Auto , Int ))

Number of minor ticks between adjacent x-axis major ticks. (default: ‘auto’)

x_range (Any )

Customize the x-range of the plot. (default: None)

y_axis_label (String )

A label for the y-axis. (default: ‘’)

y_axis_location (Enum ( HorizontalLocation ))

Where the y-axis should be located. (default: ‘left’)

y_axis_type (Either ( Auto , Enum ( Enumeration(linear, log, datetime, mercator) ) ))

The type of the y-axis. (default: ‘auto’)

y_minor_ticks (Either ( Auto , Int ))

Number of minor ticks between adjacent y-axis major ticks. (default: ‘auto’)

y_range (Any )

Customize the y-range of the plot. (default: None)

annular_wedge(x, y, inner_radius, outer_radius, start_angle, end_angle, direction='anticlock', *, end_angle_units='rad', fill_alpha=1.0, fill_color='gray', 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', tags=[], **kwargs)[source]

Configure and add AnnularWedge glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the center of the annular wedges.

  • y (NumberSpec) – The y-coordinates of the center of the annular wedges.

  • inner_radius (DistanceSpec) – The inner radii of the annular wedges.

  • outer_radius (DistanceSpec) – The outer radii of the annular wedges.

  • start_angle (AngleSpec) – The angles to start the annular wedges, as measured from the horizontal.

  • end_angle (AngleSpec) – The angles to end the annular wedges, as measured from the horizontal.

  • direction (Enum ( Direction ), optional) –

    Which direction to stroke between the start and end angles.

    (default: anticlock)

Keyword Arguments
  • end_angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , 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)

  • inner_radius_units (Enum ( SpatialUnits ), optional) – (default: data)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the annular wedges.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the annular wedges.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the annular wedges.

    (default: 0)

  • line_join (Enum ( LineJoin ), 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 (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 (Enum ( SpatialUnits ), optional) – (default: data)

  • start_angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

annulus(x, y, inner_radius, outer_radius, *, fill_alpha=1.0, fill_color='gray', 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', tags=[], **kwargs)[source]

Configure and add Annulus glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the center of the annuli.

  • y (NumberSpec) – The y-coordinates of the center of the annuli.

  • inner_radius (DistanceSpec) – The inner radii of the annuli.

  • outer_radius (DistanceSpec) – The outer radii of the annuli.

Keyword Arguments
  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the annuli.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the annuli.

    (default: gray)

  • inner_radius_units (Enum ( SpatialUnits ), optional) – (default: data)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the annuli.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the annuli.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the annuli.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the annuli.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the annuli.

    (default: 1)

  • name (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 (Enum ( SpatialUnits ), optional) – (default: data)

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

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

show(plot)
arc(x, y, radius, start_angle, end_angle, direction='anticlock', *, 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', tags=[], **kwargs)[source]

Configure and add Arc glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the center of the arcs.

  • y (NumberSpec) – The y-coordinates of the center of the arcs.

  • radius (DistanceSpec) – Radius of the arc.

  • start_angle (AngleSpec) – The angles to start the arcs, as measured from the horizontal.

  • end_angle (AngleSpec) – The angles to end the arcs, as measured from the horizontal.

  • direction (Enum ( Direction ), optional) –

    Which direction to stroke between the start and end angles.

    (default: anticlock)

Keyword Arguments
  • end_angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the arcs.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the arcs.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the arcs.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the arcs.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the arcs.

    (default: 1)

  • name (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 (Enum ( SpatialUnits ), optional) – (default: data)

  • start_angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

asterisk(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Asterisk glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

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

show(plot)
bezier(x0, y0, x1, y1, cx0, cy0, cx1, cy1, *, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Bezier glyphs to this Figure.

Parameters
  • x0 (NumberSpec) – The x-coordinates of the starting points.

  • y0 (NumberSpec) – The y-coordinates of the starting points.

  • x1 (NumberSpec) – The x-coordinates of the ending points.

  • y1 (NumberSpec) – The y-coordinates of the ending points.

  • cx0 (NumberSpec) – The x-coordinates of first control points.

  • cy0 (NumberSpec) – The y-coordinates of first control points.

  • cx1 (NumberSpec) – The x-coordinates of second control points.

  • cy1 (NumberSpec) – The y-coordinates of second control points.

Keyword Arguments
  • line_alpha (NumberSpec , optional) –

    The line alpha values for the Bezier curves.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the Bezier curves.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the Bezier curves.

    (default: 0)

  • line_join (Enum ( LineJoin ), 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 (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

circle(x, y, *, angle=0.0, angle_units='rad', fill_alpha=1.0, fill_color='gray', 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, tags=[], **kwargs)[source]

Configure and add Circle glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

Keyword Arguments
  • angle (AngleSpec) –

    The angles to rotate the markers.

    (default: 0.0)

  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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 (DistanceSpec) –

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

    Note

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

    Warning

    Note that Circle glyphs are always drawn as circles on the screen, even in cases where the data space aspect ratio is not 1-1. In all cases where radius values are specified, the “distance” for the radius is measured along the dimension specified by radius_dimension. If the aspect ratio is very large or small, the drawn circles may appear much larger or smaller than expected. See #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 (Enum ( SpatialUnits ), optional) – (default: data)

  • size (ScreenDistanceSpec , optional) –

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

    (default: 4)

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s 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(plot_width=300, plot_height=300)
plot.circle(x=[1, 2, 3], y=[1, 2, 3], size=20)

show(plot)
circle_cross(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add CircleCross glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add CircleCross glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add CircleX glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add CircleX glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.circle_y(x=[1, 2, 3], y=[1, 2, 3], size=20,
              color="#DD1C77", fill_alpha=0.2)

show(plot)
cross(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Cross glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.cross(x=[1, 2, 3], y=[1, 2, 3], size=20,
           color="#E6550D", line_width=2)

show(plot)
dash(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Dash glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.dash(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
          color="#99D594", line_width=2)

show(plot)
diamond(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Diamond glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.diamond(x=[1, 2, 3], y=[1, 2, 3], size=20,
             color="#1C9099", line_width=2)

show(plot)
diamond_cross(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add DiamondCross glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add DiamondDot glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.diamond_dot(x=[1, 2, 3], y=[1, 2, 3], size=20,
                 color="#386CB0", fill_color=None)

show(plot)
dot(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Dot glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.dot(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#386CB0")

show(plot)
ellipse(x, y, width, height, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', 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, tags=[], width_units='data', **kwargs)[source]

Configure and add Ellipse glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the centers of the ellipses.

  • y (NumberSpec) – The y-coordinates of the centers of the ellipses.

  • width (DistanceSpec) – The widths of each ellipse.

  • height (DistanceSpec) – The heights of each ellipse.

  • angle (AngleSpec) –

    The angle the ellipses are rotated from horizontal. [rad]

    (default: 0.0)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the ovals.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the ovals.

    (default: gray)

  • height_units (Enum ( SpatialUnits ), optional) – (default: data)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the ovals.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the ovals.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the ovals.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the ovals.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the ovals.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the ovals.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the ovals.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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 (Enum ( SpatialUnits ), optional) – (default: data)

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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)
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, x2, y, *, 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, tags=[], **kwargs)[source]

Configure and add HArea glyphs to this Figure.

Parameters
  • x1 (NumberSpec) – The x-coordinates for the points of one side of the area.

  • x2 (NumberSpec) – The x-coordinates for the points of the other side of the area.

  • y (NumberSpec) – The y-coordinates for the points of the area.

Keyword Arguments
  • fill_alpha (Percent , optional) –

    The fill alpha values for the horizontal directed area.

    (default: 1.0)

  • fill_color (Color , optional) –

    The fill color values for the horizontal directed area.

    (default: gray)

  • hatch_alpha (NumberSpec , 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 ( 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)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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')
hbar(y, height, right, left=0, *, 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, tags=[], **kwargs)[source]

Configure and add HBar glyphs to this Figure.

Parameters
  • y (NumberSpec) – The y-coordinates of the centers of the horizontal bars.

  • height (NumberSpec) – The heights of the vertical bars.

  • right (NumberSpec) – The x-coordinates of the right edges.

  • left (NumberSpec) –

    The x-coordinates of the left edges.

    (default: 0)

Keyword Arguments
  • fill_alpha (NumberSpec , 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 (NumberSpec , 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 ( 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 (NumberSpec , optional) –

    The line alpha values for the horizontal bars.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the horizontal bars.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the horizontal bars.

    (default: 0)

  • line_join (Enum ( LineJoin ), 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 (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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'], x=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'),         x=10, width=0.9, color='blue', source=source, name='2016')
p.hbar(bottom=stack('2016'), top=stack('2016', '2017'), x=10, width=0.9, color='red',  source=source, name='2017')
hex(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Hex glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.hex(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1")

show(plot)
hex_dot(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Hex glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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, r, *, aspect_scale=1.0, fill_alpha=1.0, fill_color='gray', 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, tags=[], **kwargs)[source]

Configure and add HexTile glyphs to this Figure.

Parameters
  • q (NumberSpec) – The “column” axial coordinates of the tile centers.

  • r (NumberSpec) – The “row” axial coordinates of the tile centers.

Keyword Arguments
  • aspect_scale (Float , optional) – (default: 1.0)

  • fill_alpha (NumberSpec , 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)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the horizontal bars.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the horizontal bars.

    (default: butt)

  • line_color (ColorSpec) – The line color values for the horizontal bars.

  • line_dash (DashPattern) –

    The line dash values for the horizontal bars.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the horizontal bars.

    (default: 0)

  • line_join (Enum ( LineJoin ), 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 (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) – (default: pointytop)

  • scale (NumberSpec , optional) –

    A scale factor for individual tiles.

    (default: 1.0)

  • size (Float , optional) –

    The radius (in data space 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)

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_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')
image(image, x, y, dw, dh, dilate=False, *, color_mapper=None, dh_units='data', dw_units='data', global_alpha=1.0, name=None, palette, tags=[], **kwargs)[source]

Configure and add Image glyphs to this Figure.

Parameters
  • image (NumberSpec) – The arrays of scalar data for the images to be colormapped.

  • x (NumberSpec) – The x-coordinates to locate the image anchors.

  • y (NumberSpec) – The y-coordinates to locate the image anchors.

  • dw (DistanceSpec) –

    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.

  • dh (DistanceSpec) –

    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.

  • 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)

Keyword Arguments
  • color_mapper (Instance ( ColorMapper )) –

    A ColorMapper to use to map the scalar data from image into RGBA values for display.

    Note

    The color mapping step happens on the client.

  • dh_units (Enum ( SpatialUnits ), optional) – (default: data)

  • dw_units (Enum ( SpatialUnits ), optional) – (default: data)

  • global_alpha (Float , optional) –

    An overall opacity that each image is rendered with (in addition to any alpha values applied explicitly in a color mapper).

    (default: 1.0)

  • name (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.

  • palette (str or list[color value]) –

  • palette to construct a value for the color mapper property from (a) –

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Note

If both palette and color_mapper are passed, a ValueError exception will be raised. If neither is passed, then the Greys9 palette will be used as a default.

image_rgba(image, x, y, dw, dh, dilate=False, *, dh_units='data', dw_units='data', global_alpha=1.0, name=None, tags=[], **kwargs)[source]

Configure and add ImageRGBA glyphs to this Figure.

Parameters
  • image (NumberSpec) – The arrays of RGBA data for the images.

  • x (NumberSpec) – The x-coordinates to locate the image anchors.

  • y (NumberSpec) – The y-coordinates to locate the image anchors.

  • dw (DistanceSpec) –

    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.

  • dh (DistanceSpec) –

    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.

  • 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)

Keyword Arguments
  • dh_units (Enum ( SpatialUnits ), optional) – (default: data)

  • dw_units (Enum ( SpatialUnits ), optional) – (default: data)

  • global_alpha (Float , optional) –

    An overall opacity that each image is rendered with (in addition to any inherent alpha values in the image itself).

    (default: 1.0)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Note

The image_rgba method accepts images as a two-dimensional array of RGBA values (encoded as 32-bit integers).

image_url(url, x, y, w, h, angle=0, dilate=False, *, anchor='top_left', angle_units='rad', global_alpha=1.0, h_units='data', name=None, retry_attempts=0, retry_timeout=0, tags=[], w_units='data', **kwargs)[source]

Configure and add ImageURL glyphs to this Figure.

Parameters
  • url (StringSpec) –

    The URLs to retrieve images from.

    Note

    The actual retrieving and loading of the images happens on the client.

  • x (NumberSpec) – The x-coordinates to locate the image anchors.

  • y (NumberSpec) – The y-coordinates to locate the image anchors.

  • w (DistanceSpec) –

    The width of the plot region that the image will occupy in data space.

    The default value is None, in which case the image will be displayed at its actual image size (regardless of the units specified here).

  • h (DistanceSpec) –

    The height of the plot region that the image will occupy in data space.

    The default value is None, in which case the image will be displayed at its actual image size (regardless of the units specified here).

  • angle (AngleSpec) –

    The angles to rotate the images, as measured from the horizontal.

    (default: 0)

  • 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)

Keyword Arguments
  • anchor (Enum ( LegendLocation ), optional) –

    What position of the image should be anchored at the x, y coordinates.

    (default: top_left)

  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • global_alpha (Float , optional) –

    An overall opacity that each image is rendered with (in addition to any inherent alpha values in the image itself).

    (default: 1.0)

  • h_units (Enum ( SpatialUnits ), optional) – (default: data)

  • name (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.

  • retry_attempts (Int) –

    Number of attempts to retry loading the images from the specified URL. Default is zero.

    (default: 0)

  • retry_timeout (Int) –

    Timeout (in ms) between retry attempts to load the image from the specified URL. Default is zero ms.

    (default: 0)

  • tags (List ( Any )) –

    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: [])

  • w_units (Enum ( SpatialUnits ), optional) – (default: data)

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

inverted_triangle(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add InvertedTriangle glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.inverted_triangle(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26")

show(plot)
line(x, y, *, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Line glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates for the points of the line.

  • y (NumberSpec) – The y-coordinates for the points of the line.

Keyword Arguments
  • line_alpha (Percent , optional) –

    The line alpha values for the line.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the line.

    (default: butt)

  • line_color (Color , optional) –

    The line color values for the line.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the line.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the line.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the line.

    (default: bevel)

  • line_width (Float , optional) –

    The line width values for the line.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

p = figure(title="line", plot_width=300, plot_height=300)
p.line(x=[1, 2, 3, 4, 5], y=[6, 7, 2, 4, 5])

show(p)
multi_line(xs, ys, *, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add MultiLine glyphs to this Figure.

Parameters
  • xs (NumberSpec) – The x-coordinates for all the lines, given as a “list of lists”.

  • ys (NumberSpec) – The y-coordinates for all the lines, given as a “list of lists”.

Keyword Arguments
  • line_alpha (NumberSpec , optional) –

    The line alpha values for the lines.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the lines.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the lines.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the lines.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the lines.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the lines.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the lines.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Note

For this glyph, the data is not simply an array of scalars, it is an “array of arrays”.

Examples

from bokeh.plotting import figure, output_file, show

p = figure(plot_width=300, plot_height=300)
p.multi_line(xs=[[1, 2, 3], [2, 3, 4]], ys=[[6, 7, 2], [4, 5, 7]],
            color=['red','green'])

show(p)
multi_polygons(xs, ys, *, 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, tags=[], **kwargs)[source]

Configure and add MultiPolygons glyphs to this Figure.

Parameters
  • xs (NumberSpec) –

    The x-coordinates for all the patches, given as a nested list.

    Note

    Each item in MultiPolygons represents one MultiPolygon and each MultiPolygon is comprised of n Polygons. Each Polygon is made of one exterior ring optionally followed by m interior rings (holes).

  • ys (NumberSpec) –

    The y-coordinates for all the patches, given as a “list of lists”.

    Note

    Each item in MultiPolygons represents one MultiPolygon and each MultiPolygon is comprised of n Polygons. Each Polygon is made of one exterior ring optionally followed by m interior rings (holes).

Keyword Arguments
  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the multipolygons.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the multipolygons.

    (default: gray)

  • hatch_alpha (NumberSpec , optional) –

    The hatch alpha values for the patches.

    (default: 1.0)

  • hatch_color (ColorSpec , optional) –

    The hatch color values for the patches.

    (default: black)

  • hatch_extra (Dict ( String , Instance ( Texture ) )) –

    The hatch extra values for the patches.

    (default: {})

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

  • hatch_scale (NumberSpec , optional) –

    The hatch scale values for the patches.

    (default: 12.0)

  • hatch_weight (NumberSpec , optional) –

    The hatch weight values for the patches.

    (default: 1.0)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the multipolygons.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the multipolygons.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the multipolygons.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the multipolygons.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the multipolygons.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the multipolygons.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the multipolygons.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Note

For this glyph, the data is not simply an array of scalars, it is a nested array.

Examples

from bokeh.plotting import figure, output_file, show

p = figure(plot_width=300, plot_height=300)
p.multi_polygons(xs=[[[[1, 1, 2, 2]]], [[[1, 1, 3], [1.5, 1.5, 2]]]],
                ys=[[[[4, 3, 3, 4]]], [[[1, 3, 1], [1.5, 2, 1.5]]]],
                color=['red', 'green'])
show(p)
oval(x, y, width, height, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', 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, tags=[], width_units='data', **kwargs)[source]

Configure and add Oval glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the centers of the ovals.

  • y (NumberSpec) – The y-coordinates of the centers of the ovals.

  • width (DistanceSpec) – The overall widths of each oval.

  • height (DistanceSpec) – The overall height of each oval.

  • angle (AngleSpec) –

    The angle the ovals are rotated from horizontal. [rad]

    (default: 0.0)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the ovals.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the ovals.

    (default: gray)

  • height_units (Enum ( SpatialUnits ), optional) – (default: data)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the ovals.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the ovals.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the ovals.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the ovals.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the ovals.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the ovals.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the ovals.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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 (Enum ( SpatialUnits ), optional) – (default: data)

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.oval(x=[1, 2, 3], y=[1, 2, 3], width=0.2, height=0.4,
          angle=-0.7, color="#1D91C0")

show(plot)
patch(x, y, *, 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, tags=[], **kwargs)[source]

Configure and add Patch glyphs to this Figure.

Parameters
  • x (NumberSpec) –

    The x-coordinates for the points of the patch.

    Note

    A patch may comprise multiple polygons. In this case the x-coordinates for each polygon should be separated by NaN values in the sequence.

  • y (NumberSpec) –

    The y-coordinates for the points of the patch.

    Note

    A patch may comprise multiple polygons. In this case the y-coordinates for each polygon should be separated by NaN values in the sequence.

Keyword Arguments
  • fill_alpha (Percent , optional) –

    The fill alpha values for the patch.

    (default: 1.0)

  • fill_color (Color , optional) –

    The fill color values for the patch.

    (default: gray)

  • hatch_alpha (Percent , optional) –

    The hatch alpha values for the patch.

    (default: 1.0)

  • hatch_color (Color , optional) –

    The hatch color values for the patch.

    (default: black)

  • hatch_extra (Dict ( String , Instance ( Texture ) )) –

    The hatch extra values for the patch.

    (default: {})

  • hatch_pattern (String) – The hatch pattern values for the patch.

  • hatch_scale (Size , optional) –

    The hatch scale values for the patch.

    (default: 12.0)

  • hatch_weight (Size , optional) –

    The hatch weight values for the patch.

    (default: 1.0)

  • line_alpha (Percent , optional) –

    The line alpha values for the patch.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the patch.

    (default: butt)

  • line_color (Color , optional) –

    The line color values for the patch.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the patch.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the patch.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the patch.

    (default: bevel)

  • line_width (Float , optional) –

    The line width values for the patch.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

p = figure(plot_width=300, plot_height=300)
p.patch(x=[1, 2, 3, 2], y=[6, 7, 2, 2], color="#99d8c9")

show(p)
patches(xs, ys, *, 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, tags=[], **kwargs)[source]

Configure and add Patches glyphs to this Figure.

Parameters
  • xs (NumberSpec) –

    The x-coordinates for all the patches, given as a “list of lists”.

    Note

    Individual patches may comprise multiple polygons. In this case the x-coordinates for each polygon should be separated by NaN values in the sublists.

  • ys (NumberSpec) –

    The y-coordinates for all the patches, given as a “list of lists”.

    Note

    Individual patches may comprise multiple polygons. In this case the y-coordinates for each polygon should be separated by NaN values in the sublists.

Keyword Arguments
  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the patches.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the patches.

    (default: gray)

  • hatch_alpha (NumberSpec , optional) –

    The hatch alpha values for the patches.

    (default: 1.0)

  • hatch_color (ColorSpec , optional) –

    The hatch color values for the patches.

    (default: black)

  • hatch_extra (Dict ( String , Instance ( Texture ) )) –

    The hatch extra values for the patches.

    (default: {})

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

  • hatch_scale (NumberSpec , optional) –

    The hatch scale values for the patches.

    (default: 12.0)

  • hatch_weight (NumberSpec , optional) –

    The hatch weight values for the patches.

    (default: 1.0)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the patches.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the patches.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the patches.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the patches.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the patches.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the patches.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the patches.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Note

For this glyph, the data is not simply an array of scalars, it is an “array of arrays”.

Examples

from bokeh.plotting import figure, output_file, show

p = figure(plot_width=300, plot_height=300)
p.patches(xs=[[1,2,3],[4,5,6,5]], ys=[[1,2,1],[4,5,5,4]],
          color=["#43a2ca", "#a8ddb5"])

show(p)
plus(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Plus glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.plus(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26")

show(plot)
quad(left, right, top, bottom, *, 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, tags=[], **kwargs)[source]

Configure and add Quad glyphs to this Figure.

Parameters
  • left (NumberSpec) – The x-coordinates of the left edges.

  • right (NumberSpec) – The x-coordinates of the right edges.

  • top (NumberSpec) – The y-coordinates of the top edges.

  • bottom (NumberSpec) – The y-coordinates of the bottom edges.

Keyword Arguments
  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the quads.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the quads.

    (default: gray)

  • hatch_alpha (NumberSpec , 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 ( 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 (NumberSpec , optional) –

    The line alpha values for the quads.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the quads.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the quads.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the quads.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the quads.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the quads.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the quads.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.quad(top=[2, 3, 4], bottom=[1, 2, 3], left=[1, 2, 3],
          right=[1.2, 2.5, 3.7], color="#B3DE69")

show(plot)
quadratic(x0, y0, x1, y1, cx, cy, *, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Quadratic glyphs to this Figure.

Parameters
  • x0 (NumberSpec) – The x-coordinates of the starting points.

  • y0 (NumberSpec) – The y-coordinates of the starting points.

  • x1 (NumberSpec) – The x-coordinates of the ending points.

  • y1 (NumberSpec) – The y-coordinates of the ending points.

  • cx (NumberSpec) – The x-coordinates of the control points.

  • cy (NumberSpec) – The y-coordinates of the control points.

Keyword Arguments
  • line_alpha (NumberSpec , optional) –

    The line alpha values for the parabolas.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the parabolas.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the parabolas.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the parabolas.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the parabolas.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the parabolas.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the parabolas.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

ray(x, y, length, angle, *, angle_units='rad', length_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, tags=[], **kwargs)[source]

Configure and add Ray glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates to start the rays.

  • y (NumberSpec) – The y-coordinates to start the rays.

  • length (DistanceSpec) – The length to extend the ray. Note that this length defaults to data units (measured in the x-direction).

  • angle (AngleSpec) – The angles in radians to extend the rays, as measured from the horizontal.

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • length_units (Enum ( SpatialUnits ), optional) – (default: data)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the rays.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the rays.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the rays.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the rays.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the rays.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the rays.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the rays.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.ray(x=[1, 2, 3], y=[1, 2, 3], length=45, angle=-0.7, color="#FB8072",
        line_width=2)

show(plot)
rect(x, y, width, height, angle=0.0, dilate=False, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', 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, tags=[], width_units='data', **kwargs)[source]

Configure and add Rect glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the centers of the rectangles.

  • y (NumberSpec) – The y-coordinates of the centers of the rectangles.

  • width (DistanceSpec) – The overall widths of the rectangles.

  • height (DistanceSpec) – The overall heights of the rectangles.

  • angle (AngleSpec) –

    The angles to rotate the rectangles, as measured from the horizontal.

    (default: 0.0)

  • dilate (Bool) –

    Whether to always round fractional pixel locations in such a way as to make the rectangles bigger.

    This setting may be useful if pixel rounding errors are causing rectangles to have a gap between them, when they should appear flush.

    (default: False)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the rectangles.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the rectangles.

    (default: gray)

  • height_units (Enum ( SpatialUnits ), optional) – (default: data)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the rectangles.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the rectangles.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the rectangles.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the rectangles.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the rectangles.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the rectangles.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the rectangles.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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 (Enum ( SpatialUnits ), optional) – (default: data)

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.rect(x=[1, 2, 3], y=[1, 2, 3], width=10, height=20, color="#CAB2D6",
          width_units="screen", height_units="screen")

show(plot)
scatter(*args, **kwargs)[source]

Creates a scatter plot of the given x and y items.

Parameters
  • x (str or seq[float]) – values or field names of center x coordinates

  • y (str or seq[float]) – values or field names of center y coordinates

  • size (str or list[float]) – values or field names of sizes in screen units

  • marker (str, or list[str]) – values or field names of marker types

  • color (color value, optional) – shorthand to set both fill and line color

  • source (ColumnDataSource) – a user-supplied data source. An attempt will be made to convert the object to ColumnDataSource if needed. If none is supplied, one is created for the user automatically.

  • **kwargsLine Properties and Fill Properties

Examples

>>> p.scatter([1,2,3],[4,5,6], marker="square", fill_color="red")
>>> p.scatter("data1", "data2", marker="mtype", source=data_source, ...)

Note

When passing marker="circle" it is also possible to supply a radius value in data-space units. When configuring marker type from a data source column, all markers including circles may only be configured with size in screen units.

segment(x0, y0, x1, y1, *, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Segment glyphs to this Figure.

Parameters
  • x0 (NumberSpec) – The x-coordinates of the starting points.

  • y0 (NumberSpec) – The y-coordinates of the starting points.

  • x1 (NumberSpec) – The x-coordinates of the ending points.

  • y1 (NumberSpec) – The y-coordinates of the ending points.

Keyword Arguments
  • line_alpha (NumberSpec , optional) –

    The line alpha values for the segments.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the segments.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the segments.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the segments.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the segments.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the segments.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the segments.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.segment(x0=[1, 2, 3], y0=[1, 2, 3],
             x1=[1, 2, 3], y1=[1.2, 2.5, 3.7],
             color="#F4A582", line_width=3)

show(plot)
square(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Square glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.square(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1")

show(plot)
square_cross(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add SquareCross glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.square_cross(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                  color="#7FC97F",fill_color=None, line_width=2)

show(plot)
square_dot(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add SquareDot glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.square_dot(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                color="#7FC97F", fill_color=None)

show(plot)
square_pin(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add SquarePin glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.square_pin(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                color="#7FC97F",fill_color=None, line_width=2)

show(plot)
square_x(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add SquareX glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.square_x(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
              color="#FDAE6B",fill_color=None, line_width=2)

show(plot)
step(x, y, *, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, mode='before', name=None, tags=[], **kwargs)[source]

Configure and add Step glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates for the steps.

  • y (NumberSpec) – The y-coordinates for the steps.

Keyword Arguments
  • line_alpha (NumberSpec , optional) –

    The line alpha values for the steps.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the steps.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the steps.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the steps.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the steps.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the steps.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the steps.

    (default: 1)

  • 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 x-coordinate (no step before the first point)

    • after: Draw step levels after each x-coordinate (no step after the last point)

    • center: Draw step levels centered on each x-coordinate

    (default: before)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.step(x=[1, 2, 3, 4, 5], y=[1, 2, 3, 2, 5], color="#FB8072")

show(plot)
text(x, y, text='text', angle=0, x_offset=0, y_offset=0, *, angle_units='rad', name=None, tags=[], text_align='left', text_alpha=1.0, text_baseline='bottom', text_color='#444444', text_font='helvetica', text_font_size={'value': '16px'}, text_font_style='normal', text_line_height=1.2, **kwargs)[source]

Configure and add Text glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates to locate the text anchors.

  • y (NumberSpec) – The y-coordinates to locate the text anchors.

  • text (StringSpec , optional) –

    The text values to render.

    (default: text)

  • angle (AngleSpec) –

    The angles to rotate the text, as measured from the horizontal.

    (default: 0)

  • x_offset (NumberSpec) –

    Offset values to apply to the x-coordinates.

    This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

    (default: 0)

  • y_offset (NumberSpec) –

    Offset values to apply to the y-coordinates.

    This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

    (default: 0)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • name (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.

  • tags (List ( Any )) –

    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: [])

  • text_align (Enum ( TextAlign ), optional) –

    The text align values for the text.

    (default: left)

  • text_alpha (NumberSpec , optional) –

    The text alpha values for the text.

    (default: 1.0)

  • text_baseline (Enum ( TextBaseline ), optional) –

    The text baseline values for the text.

    (default: bottom)

  • text_color (ColorSpec , optional) –

    The text color values for the text.

    (default: #444444)

  • text_font (String , optional) –

    The text font values for the text.

    (default: helvetica)

  • text_font_size (FontSizeSpec , optional) –

    The text font size values for the text.

    (default: {‘value’: ‘16px’})

  • text_font_style (Enum ( FontStyle ), optional) –

    The text font style values for the text.

    (default: normal)

  • text_line_height (Float , optional) –

    The text line height values for the text.

    (default: 1.2)

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Note

The location and angle of the text relative to the x, y coordinates is indicated by the alignment and baseline text properties.

triangle(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Triangle glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.triangle(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
              color="#99D594", line_width=2)

show(plot)
triangle_dot(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add TriangleDot glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.triangle_dot(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                  color="#99D594", fill_color=None)

show(plot)
triangle_pin(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add TrianglePin glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.triangle_pin(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
              color="#99D594", line_width=2)

show(plot)
varea(x, y1, y2, *, 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, tags=[], **kwargs)[source]

Configure and add VArea glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates for the points of the area.

  • y1 (NumberSpec) – The y-coordinates for the points of one side of the area.

  • y2 (NumberSpec) – The y-coordinates for the points of the other side of the area.

Keyword Arguments
  • fill_alpha (Percent , optional) –

    The fill alpha values for the vertical directed area

    (default: 1.0)

  • fill_color (Color , optional) –

    The fill color values for the vertical directed area

    (default: gray)

  • hatch_alpha (NumberSpec , 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 ( 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)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.varea(x=[1, 2, 3], y1=[0, 0, 0], y2=[1, 4, 2],
           fill_color="#99D594")

show(plot)
varea_stack(stackers, **kw)[source]

Generate multiple VArea renderers for levels stacked bottom to top.

Parameters

stackers (seq[str]) –

a list of data source field names to stack successively for y1 and y1 varea 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 varea. 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 varea_stack will will create two VArea renderers that stack:

p.varea_stack(['2016', '2017'], x='x', color=['blue', 'red'], source=source)

This is equivalent to the following two separate calls:

p.varea(y1=stack(),       y2=stack('2016'),         x='x', color='blue', source=source, name='2016')
p.varea(y1=stack('2016'), y2=stack('2016', '2017'), x='x', color='red',  source=source, name='2017')
vbar(x, width, top, bottom=0, *, 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, tags=[], **kwargs)[source]

Configure and add VBar glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the centers of the vertical bars.

  • width (NumberSpec) – The widths of the vertical bars.

  • top (NumberSpec) – The y-coordinates of the top edges.

  • bottom (NumberSpec) –

    The y-coordinates of the bottom edges.

    (default: 0)

Keyword Arguments
  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the vertical bars.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the vertical bars.

    (default: gray)

  • hatch_alpha (NumberSpec , optional) –

    The hatch alpha values for the vertical bars.

    (default: 1.0)

  • hatch_color (ColorSpec , optional) –

    The hatch color values for the vertical bars.

    (default: black)

  • hatch_extra (Dict ( String , Instance ( Texture ) )) –

    The hatch extra values for the vertical bars.

    (default: {})

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

  • hatch_scale (NumberSpec , optional) –

    The hatch scale values for the vertical bars.

    (default: 12.0)

  • hatch_weight (NumberSpec , optional) –

    The hatch weight values for the vertical bars.

    (default: 1.0)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the vertical bars.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the vertical bars.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the vertical bars.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the vertical bars.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the vertical bars.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the vertical bars.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the vertical bars.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.vbar(x=[1, 2, 3], width=0.5, bottom=0, top=[1,2,3], color="#CAB2D6")

show(plot)
vbar_stack(stackers, **kw)[source]

Generate multiple VBar renderers for levels stacked bottom to top.

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 vbar. 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 vbar_stack will will create two VBar renderers that stack:

p.vbar_stack(['2016', '2017'], x=10, width=0.9, color=['blue', 'red'], source=source)

This is equivalent to the following two separate calls:

p.vbar(bottom=stack(),       top=stack('2016'),         x=10, width=0.9, color='blue', source=source, name='2016')
p.vbar(bottom=stack('2016'), top=stack('2016', '2017'), x=10, width=0.9, color='red',  source=source, name='2017')
vline_stack(stackers, **kw)[source]

Generate multiple Line renderers for lines stacked vertically.

Parameters

stackers (seq[str]) – a list of data source field names to stack successively for y 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 vline_stack with stackers for the y-coordinates will will create two Line renderers that stack:

p.vline_stack(['2016', '2017'], x='x', color=['blue', 'red'], source=source)

This is equivalent to the following two separate calls:

p.line(y=stack('2016'),         x='x', color='blue', source=source, name='2016')
p.line(y=stack('2016', '2017'), x='x', color='red',  source=source, name='2017')
wedge(x, y, radius, start_angle, end_angle, direction='anticlock', *, end_angle_units='rad', fill_alpha=1.0, fill_color='gray', 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', tags=[], **kwargs)[source]

Configure and add Wedge glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-coordinates of the points of the wedges.

  • y (NumberSpec) – The y-coordinates of the points of the wedges.

  • radius (DistanceSpec) – Radii of the wedges.

  • start_angle (AngleSpec) – The angles to start the wedges, as measured from the horizontal.

  • end_angle (AngleSpec) – The angles to end the wedges, as measured from the horizontal.

  • direction (Enum ( Direction ), optional) –

    Which direction to stroke between the start and end angles.

    (default: anticlock)

Keyword Arguments
  • end_angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the wedges.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the wedges.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the wedges.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), optional) –

    The line cap values for the wedges.

    (default: butt)

  • line_color (ColorSpec , optional) –

    The line color values for the wedges.

    (default: black)

  • line_dash (DashPattern) –

    The line dash values for the wedges.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the wedges.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the wedges.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the wedges.

    (default: 1)

  • name (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 (Enum ( SpatialUnits ), optional) – (default: data)

  • start_angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.wedge(x=[1, 2, 3], y=[1, 2, 3], radius=15, start_angle=0.6,
           end_angle=4.1, radius_units="screen", color="#2b8cbe")

show(plot)
x(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add X glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.x(x=[1, 2, 3], y=[1, 2, 3], size=[10, 20, 25], color="#fa9fb5")

show(plot)
y(x, y, size=4, angle=0.0, *, angle_units='rad', fill_alpha=1.0, fill_color='gray', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, tags=[], **kwargs)[source]

Configure and add Y glyphs to this Figure.

Parameters
  • x (NumberSpec) – The x-axis coordinates for the center of the markers.

  • y (NumberSpec) – The y-axis coordinates for the center of the markers.

  • size (ScreenDistanceSpec , 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)

Keyword Arguments
  • angle_units (Enum ( AngleUnits ), optional) – (default: rad)

  • fill_alpha (NumberSpec , optional) –

    The fill alpha values for the markers.

    (default: 1.0)

  • fill_color (ColorSpec , optional) –

    The fill color values for the markers.

    (default: gray)

  • line_alpha (NumberSpec , optional) –

    The line alpha values for the markers.

    (default: 1.0)

  • line_cap (Enum ( LineCap ), 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 (DashPattern) –

    The line dash values for the markers.

    (default: [])

  • line_dash_offset (Int) –

    The line dash offset values for the markers.

    (default: 0)

  • line_join (Enum ( LineJoin ), optional) –

    The line join values for the markers.

    (default: bevel)

  • line_width (NumberSpec , optional) –

    The line width values for the markers.

    (default: 1)

  • name (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.

  • tags (List ( Any )) –

    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: [])

Other Parameters
  • 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)

    Acceptable values for colors are described in the Specifying Colors section of the User’s Guide.

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

  • legend_field (str, optional) – Specify that the glyph should produce multiple legend entried by Grouping in the Browser. The value of this parameter is the name of a column in the data source that should be used or the grouping.

    The grouping is performed in JavaScript, at the time 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 entried by Grouping in Python. The value of this parameter is the name of a column in the data source that should be used or 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 exactly the 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 drive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed valued (e.g. x=10) or column names in the data souce (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.

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 relevane 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 Glyphs section od the User’s Guide for full details.

Returns

GlyphRenderer

Examples

from bokeh.plotting import figure, output_file, show

plot = figure(plot_width=300, plot_height=300)
plot.y(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26")

show(plot)
gmap(google_api_key, map_options, **kwargs)[source]

Create a new GMap for plotting.

Parameters

In addition to the standard GMap keyword arguments (e.g. plot_width or sizing_mode), the following additional options can be passed as well:

Keyword Args:

active_drag (Either ( Auto , String , Instance ( Drag ) ))

Which drag tool should initially be active. (default: ‘auto’)

active_inspect (Either ( Auto , String , Instance ( Inspection ), Seq ( Instance ( Inspection ) ) ))

Which drag tool should initially be active. (default: ‘auto’)

active_scroll (Either ( Auto , String , Instance ( Scroll ) ))

Which scroll tool should initially be active. (default: ‘auto’)

active_tap (Either ( Auto , String , Instance ( Tap ) ))

Which tap tool should initially be active. (default: ‘auto’)

tools (Either ( String , Seq ( Either ( String , Instance ( Tool ) ) ) ))

Tools the plot should start with. (default: ‘pan,wheel_zoom,reset,help’)

x_axis_label (String )

A label for the x-axis. (default: ‘’)

x_axis_location (Enum ( VerticalLocation ))

Where the x-axis should be located. (default: ‘below’)

x_minor_ticks (Either ( Auto , Int ))

Number of minor ticks between adjacent x-axis major ticks. (default: ‘auto’)

y_axis_label (String )

A label for the y-axis. (default: ‘’)

y_axis_location (Enum ( HorizontalLocation ))

Where the y-axis should be located. (default: ‘left’)

y_minor_ticks (Either ( Auto , Int ))

Number of minor ticks between adjacent y-axis major ticks. (default: ‘auto’)

Returns

GMap

class GMapPlot(*args, **kw)[source]

A Bokeh Plot with a Google Map displayed underneath.

Data placed on this plot should be specified in decimal lat/lon coordinates e.g. (37.123, -122.404). It will be automatically converted into the web mercator projection to display properly over google maps tiles.

The api_key property must be configured with a Google API Key in order for GMapPlot to function. The key will be stored in the Bokeh Document JSON.

Note that Google Maps exert explicit control over aspect ratios at all times, which imposes some limitations on GMapPlot:

  • Only Range1d ranges are supported. Attempting to use other range types will result in an error.

  • Usage of BoxZoomTool is incompatible with GMapPlot. Adding a BoxZoomTool will have no effect.

api_key

property type: Base64String

Google Maps API requires an API key. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.

map_options

property type: Instance ( GMapOptions )

Options for displaying the plot.

from_networkx(graph, layout_function, **kwargs)[source]

Generate a GraphRenderer from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function.

Only two dimensional layouts are supported.

Parameters
  • graph (networkx.Graph) – a networkx graph to render

  • layout_function (function or dict) – a networkx layout function or mapping of node keys to positions.

  • position is a two element sequence containing the x and y coordinate. (The) –

Returns

instance (GraphRenderer)

Note

Node and edge attributes may be lists or tuples. However, a given attribute must either have all lists or tuple values, or all scalar values, for nodes or edges it is defined on.

Warning

Node attributes labeled ‘index’ and edge attributes labeled ‘start’ or ‘end’ are ignored. If you want to convert these attributes, please re-label them to other names.

Raises

ValueError