gmap#
The gmap
function is similar to figure()
, but configures a plot that also
has a Google Maps underlay.
gmap#
- gmap(google_api_key, map_options, **kwargs) GMap [source]#
Create a new
GMap
for plotting.- Parameters:
google_api_key (str) –
Google requires an API key be supplied for maps to function. See:
https://developers.google.com/maps/documentation/javascript/get-api-key
The Google API key will be stored as a base64-encoded string in the Bokeh Document JSON.
map_options – (
GMapOptions
) Configuration specific to a Google Map
All other keyword arguments are passed to
GMap
.- Returns:
GMap#
- class GMap(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Bases:
GMapPlot
,GlyphAPI
A subclass of
Plot
that simplifies plot creation with default axes, grids, tools, etc.- Parameters:
google_api_key (str) –
Google requires an API key be supplied for maps to function. See:
https://developers.google.com/maps/documentation/javascript/get-api-key
map_options – (
GMapOptions
) Configuration specific to a Google Map
In addition to all the Bokeh model property attributes documented below, the
Figure
initializer also accepts the following options, which can help simplify configuration:- Keyword Arguments:
- active_inspect (
Nullable
(Either
(Auto
,String
,Instance
(InspectTool
),Seq
(Instance
(InspectTool
))))): Which drag tool should initially be active. (default: ‘auto’)
- active_inspect (
- tooltips (
Nullable
(Either
(Instance
(Template
),String
,List
))): 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 thetools
argument, this value will override that hover toolstooltips
value. If no hover tool is specified in thetools
argument, then passing tooltips here will cause one to be created and added. (default: None)
- tooltips (
- x_axis_label (
Nullable
(TextLike
)): A label for the x-axis. (default: ‘’)
- x_axis_label (
- x_axis_location (
Nullable
(Enum
(VerticalLocation
))): Where the x-axis should be located. (default: ‘below’)
- x_axis_location (
- y_axis_label (
Nullable
(TextLike
)): A label for the y-axis. (default: ‘’)
- y_axis_label (
- y_axis_location (
Nullable
(Enum
(HorizontalLocation
))): Where the y-axis should be located. (default: ‘left’)
- y_axis_location (
- align = 'auto'#
-
The alignment point within the parent container.
This property is useful only if this component is a child element of a layout (e.g. a grid). Self alignment can be overridden by the parent container (e.g. grid track align).
- api_key = Undefined#
-
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.
- api_version = 'weekly'#
- Type:
The version of Google Maps API to use. See https://developers.google.com/maps/documentation/javascript/versions for more information.
Note
Changing this value may result in broken map rendering.
- aspect_ratio = None#
-
Describes the proportional relationship between component’s width and height.
This works if any of component’s dimensions are flexible in size. If set to a number,
width / height = aspect_ratio
relationship will be maintained. Otherwise, if set to"auto"
, component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).
- aspect_scale = 1#
- Type:
A value to be given for increased aspect ratio control. This value is added multiplicatively to the calculated value required for
match_aspect
.aspect_scale
is defined as the ratio of width over height of the figure.For example, a plot with
aspect_scale
value of 2 will result in a square in data units to be drawn on the screen as a rectangle with a pixel width twice as long as its pixel height.Note
This setting only takes effect if
match_aspect
is set toTrue
.
- attribution = []#
- Type:
Allows to acknowledge or give credit to data, tile, etc. providers.
This can be in either HTML or plain text forms. Renderers, like tile renderers, can provide additional attributions which will be added after attributions provided here.
Note
This feature is experimental and may change in the short term.
- background_fill_color = '#ffffff'#
-
The fill color for the plot background style.
-
A menu to display when user right clicks on the component.
Note
Use shift key when right clicking to display the native context menu.
- css_variables = {}#
-
Allows to define dynamically computed CSS variables.
This can be used, for example, to coordinate positioning and styling between canvas’ renderers and/or visuals and HTML-based UI elements.
Variables defined here are equivalent to setting the same variables under
:host { ... }
in a CSS stylesheet.Note
This property is experimental and may change at any point.
- disabled = False#
- Type:
Whether the widget will be disabled when rendered.
If
True
, the widget will be greyed-out and not responsive to UI events.
- elements = []#
- Type:
A collection of DOM-based UI elements attached to this pane.
This can include floating elements like tooltips, allowing to establish a parent-child relationship between this and other UI elements.
- extra_x_ranges = {}#
-
Additional named ranges to make available for mapping x-coordinates.
This is useful for adding additional axes.
- extra_x_scales = {}#
-
Additional named scales to make available for mapping x-coordinates.
This is useful for adding additional axes.
Note
This feature is experimental and may change in the short term.
- extra_y_ranges = {}#
-
Additional named ranges to make available for mapping y-coordinates.
This is useful for adding additional axes.
- extra_y_scales = {}#
-
Additional named scales to make available for mapping y-coordinates.
This is useful for adding additional axes.
Note
This feature is experimental and may change in the short term.
- flow_mode = 'block'#
-
Defines whether the layout will flow in the
block
orinline
dimension.
- frame_align = True#
-
Allows to specify which frame edges to align in multiple-plot layouts.
The default is to align all edges, but users can opt-out from alignment of each individual edge or all edges. Note also that other properties may disable alignment of certain edges, especially when using fixed frame size (
frame_width
andframe_height
properties).
- frame_height = None#
-
The height of a plot frame or the inner height of a plot, excluding any axes, titles, border padding, etc.
- frame_width = None#
-
The width of a plot frame or the inner width of a plot, excluding any axes, titles, border padding, etc.
- height = 600#
- Type:
The height of the component (in pixels).
This can be either fixed or preferred height, depending on height sizing policy.
- height_policy = 'auto'#
- Type:
Describes how the component should maintain its height.
"auto"
Use component’s preferred sizing policy.
"fixed"
Use exactly
height
pixels. Component will overflow if it can’t fit in the available vertical space."fit"
Use component’s preferred height (if set) and allow to fit into the available vertical space within the minimum and maximum height bounds (if set). Component’s height neither will be aggressively minimized nor maximized.
"min"
Use as little vertical space as possible, not less than the minimum height (if set). The starting point is the preferred height (if set). The height of the component may shrink or grow depending on the parent layout, aspect management and other factors.
"max"
Use as much vertical space as possible, not more than the maximum height (if set). The starting point is the preferred height (if set). The height of the component may shrink or grow depending on the parent layout, aspect management and other factors.
Note
This is an experimental feature and may change in future. Use it at your own discretion. Prefer using
sizing_mode
if this level of control isn’t strictly necessary.
- hold_render = False#
- Type:
When set to True all requests to repaint the plot will be hold off.
This is useful when periodically updating many glyphs. For example, let’s assume we have 10 lines on a plot, each with its own datasource. We stream to all of them every second in a for loop like so:
for line in lines: line.stream(new_points())
The problem with this code is that every stream triggers a re-rendering of the plot. Even tough repainting only on the last stream would produce almost identical visual effect. Especially for lines with many points this becomes computationally expensive and can freeze your browser. Using a convenience method hold, we can control when rendering is initiated like so:
with plot.hold(render=True): for line in lines: line.stream(new_points())
In this case we render newly appended points only after the last stream.
- inner_height = Undefined#
- Type:
Readonly
This is the exact height of the plotting canvas, i.e. the height of the actual plot, without toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).
Note
This is an experimental feature and the API may change in near future.
- inner_width = Undefined#
- Type:
Readonly
This is the exact width of the plotting canvas, i.e. the width of the actual plot, without toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).
Note
This is an experimental feature and the API may change in near future.
- lod_interval = 300#
- Type:
Interval (in ms) during which an interactive tool event will enable level-of-detail downsampling.
- lod_threshold = 2000#
-
A number of data points, above which level-of-detail downsampling may be performed by glyph renderers. Set to
None
to disable any level-of-detail downsampling.
- lod_timeout = 500#
- Type:
Timeout (in ms) for checking whether interactive tool events are still occurring. Once level-of-detail mode is enabled, a check is made every
lod_timeout
ms. If no interactive tool events have happened, level-of-detail mode is disabled.
- map_options = Undefined#
- Type:
Options for displaying the plot.
- margin = None#
-
Allows to create additional space around the component. The values in the tuple are ordered as follows - Margin-Top, Margin-Right, Margin-Bottom and Margin-Left, similar to CSS standards. Negative margin values may be used to shrink the space from any direction.
- match_aspect = False#
- Type:
Specify the aspect ratio behavior of the plot. Aspect ratio is defined as the ratio of width over height. This property controls whether Bokeh should attempt to match the (width/height) of data space to the (width/height) in pixels of screen space.
Default is
False
which indicates that the data aspect ratio and the screen aspect ratio vary independently.True
indicates that the plot aspect ratio of the axes will match the aspect ratio of the pixel extent the axes. The end result is that a 1x1 area in data space is a square in pixels, and conversely that a 1x1 pixel is a square in data units.Note
This setting only takes effect when there are two dataranges. This setting only sets the initial plot draw and subsequent resets. It is possible for tools (single axis zoom, unconstrained box zoom) to change the aspect ratio.
Warning
This setting is incompatible with linking dataranges across multiple plots. Doing so may result in undefined behavior.
- max_height = None#
- Type:
Maximal height of the component (in pixels) if height is adjustable.
- max_width = None#
- Type:
Maximal width of the component (in pixels) if width is adjustable.
- min_border = 5#
-
A convenience property to set all all the
min_border_X
properties to the same value. If an individual border property is explicitly set, it will overridemin_border
.
- min_border_bottom = None#
-
Minimum size in pixels of the padding region below the bottom of the central plot region.
Note
This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.
- min_border_left = None#
-
Minimum size in pixels of the padding region to the left of the central plot region.
Note
This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.
- min_border_right = None#
-
Minimum size in pixels of the padding region to the right of the central plot region.
Note
This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.
- min_border_top = None#
-
Minimum size in pixels of the padding region above the top of the central plot region.
Note
This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.
- min_height = None#
- Type:
Minimal height of the component (in pixels) if height is adjustable.
- min_width = None#
- Type:
Minimal width of the component (in pixels) if width is adjustable.
- name = None#
-
An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
- outer_height = Undefined#
- Type:
Readonly
This is the exact height of the layout, i.e. the height of the actual plot, with toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).
Note
This is an experimental feature and the API may change in near future.
- outer_width = Undefined#
- Type:
Readonly
This is the exact width of the layout, i.e. the height of the actual plot, with toolbars etc. Note this is computed in a web browser, so this property will work only in backends capable of bidirectional communication (server, notebook).
Note
This is an experimental feature and the API may change in near future.
- outline_line_dash = []#
- Type:
The line dash for the plot border outline.
- output_backend = 'canvas'#
- Type:
Specify the output backend for the plot area. Default is HTML5 Canvas.
Note
When set to
webgl
, glyphs without a WebGL rendering implementation will fall back to rendering onto 2D canvas.
- renderers = []#
- Type:
A list of all glyph renderers for this plot.
This property can be manipulated by hand, but the
add_glyph
is recommended to help make sure all necessary setup is performed.
- reset_policy = 'standard'#
- Type:
How a plot should respond to being reset. By default, the standard actions are to clear any tool state history, return plot ranges to their original values, undo all selections, and emit a
Reset
event. If customization is desired, this property may be set to"event_only"
, which will suppress all of the actions except the Reset event.
- resizable = False#
- Type:
Either
(Bool
,Enum
(Dimensions
))
Whether the layout is interactively resizable, and if so in which dimensions.
- sizing_mode = None#
- Type:
How the component should size itself.
This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use
width_policy
,height_policy
andaspect_ratio
instead (those take precedence oversizing_mode
).Possible scenarios:
"inherit"
The sizing mode is inherited from the parent layout. If there is no parent layout (or parent is not a layout), then this value is treated as if no value for
sizing_mode
was provided."fixed"
Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events.
"stretch_width"
Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents.
"stretch_height"
Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents.
"stretch_both"
Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component.
"scale_width"
Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio.
"scale_height"
Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio.
"scale_both"
Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.
- styles = {}#
-
Inline CSS styles applied to the underlying DOM element.
- stylesheets = []#
- Type:
Additional style-sheets to use for the underlying DOM element.
Note that all bokeh’s components use shadow DOM, thus any included style sheets must reflect that, e.g. use
:host
CSS pseudo selector to access the root DOM element.
- syncable = True#
- Type:
Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work.
- tags = []#
- Type:
An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason.
- title = Title(id='p71342', ...)#
-
A title for the plot. Can be a text string or a Title annotation.
- title_location = 'above'#
-
Where the title will be located. Titles on the left or right side will be rotated.
- toolbar = Toolbar(id='p71411', ...)#
-
The toolbar associated with this plot which holds all the tools. It is automatically created with the plot if necessary.
- toolbar_inner = False#
- Type:
Locate the toolbar inside the frame. Setting this property to
True
makes most sense with auto-hidden toolbars.
- toolbar_location = 'right'#
-
Where the toolbar will be located. If set to None, no toolbar will be attached to the plot.
- toolbar_sticky = True#
- Type:
Stick the toolbar to the edge of the plot. Default: True. If False, the toolbar will be outside of the axes, titles etc.
- width = 600#
- Type:
The width of the component (in pixels).
This can be either fixed or preferred width, depending on width sizing policy.
- width_policy = 'auto'#
- Type:
Describes how the component should maintain its width.
"auto"
Use component’s preferred sizing policy.
"fixed"
Use exactly
width
pixels. Component will overflow if it can’t fit in the available horizontal space."fit"
Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized.
"min"
Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.
"max"
Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.
Note
This is an experimental feature and may change in future. Use it at your own discretion. Prefer using
sizing_mode
if this level of control isn’t strictly necessary.
- x_range = Range1d(id='p71650', ...)#
-
The (default) data range of the horizontal dimension of the plot.
- x_scale = LinearScale(id='p71685', ...)#
-
What kind of scale to use to convert x-coordinates in data space into x-coordinates in screen space.
- y_range = Range1d(id='p71720', ...)#
-
The (default) data range of the vertical dimension of the plot.
- y_scale = LinearScale(id='p71755', ...)#
-
What kind of scale to use to convert y-coordinates in data space into y-coordinates in screen space.
- add_glyph(source_or_glyph: Glyph | ColumnarDataSource, glyph: Glyph | None = None, **kwargs: Any) GlyphRenderer #
Adds a glyph to the plot with associated data sources and ranges.
This function will take care of creating and configuring a Glyph object, and then add it to the plot’s list of renderers.
- Parameters:
source (DataSource) – a data source for the glyphs to all use
glyph (Glyph) – the glyph to add to the Plot
- Keyword Arguments:
the (Any additional keyword arguments are passed on as-is to)
initializer. (Glyph)
- Returns:
GlyphRenderer
- add_layout(obj: Renderer, place: Literal['above', 'below', 'left', 'right', 'center'] = 'center') None #
Adds an object to the plot in a specified place.
- add_tile(tile_source: TileSource | TileProvider | str, retina: bool = False, **kwargs: Any) TileRenderer #
Adds new
TileRenderer
intoPlot.renderers
- Parameters:
tile_source (TileSource, xyzservices.TileProvider, str) – A tile source instance which contain tileset configuration
retina (bool) – Whether to use retina version of tiles (if available)
- Keyword Arguments:
renderer (Additional keyword arguments are passed on as-is to the tile)
- Returns:
TileRenderer
- Return type:
- add_tools(*tools: Tool | str) None #
Adds tools to the plot.
- Parameters:
*tools (Tool) – the tools to add to the Plot
- Returns:
None
- annular_wedge(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), inner_radius=Field(field='inner_radius', transform=Unspecified, units=Unspecified), outer_radius=Field(field='outer_radius', transform=Unspecified, units=Unspecified), start_angle=Field(field='start_angle', transform=Unspecified, units=Unspecified), end_angle=Field(field='end_angle', transform=Unspecified, units=Unspecified), direction='anticlock', *, decorations=[], end_angle_units='rad', fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, inner_radius_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, outer_radius_units='data', start_angle_units='rad', syncable=True, tags=[], **kwargs)#
Configure and add
AnnularWedge
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the center of the annular wedges. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the center of the annular wedges. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))inner_radius (
DistanceSpec
, optional) – The inner radii of the annular wedges. (default: Field(field=’inner_radius’, transform=Unspecified, units=Unspecified))outer_radius (
DistanceSpec
, optional) – The outer radii of the annular wedges. (default: Field(field=’outer_radius’, transform=Unspecified, units=Unspecified))start_angle (
AngleSpec
, optional) – The angles to start the annular wedges, as measured from the horizontal. (default: Field(field=’start_angle’, transform=Unspecified, units=Unspecified))end_angle (
AngleSpec
, optional) – The angles to end the annular wedges, as measured from the horizontal. (default: Field(field=’end_angle’, transform=Unspecified, units=Unspecified))direction (
Enum
(Direction
), optional) – Which direction to stroke between the start and end angles. (default: ‘anticlock’)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
end_angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the annular wedges. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the annular wedges. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the annular wedges. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the annular wedges. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the annular wedges. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the annular wedges.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the annular wedges. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the annular wedges. (default: 1.0)inner_radius_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the annular wedges. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the annular wedges. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the annular wedges. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the annular wedges. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the annular wedges. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the annular wedges. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the annular wedges. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
outer_radius_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)start_angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
- annulus(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), inner_radius=Field(field='inner_radius', transform=Unspecified, units=Unspecified), outer_radius=Field(field='outer_radius', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, inner_radius_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, outer_radius_units='data', syncable=True, tags=[], **kwargs)#
Configure and add
Annulus
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the center of the annuli. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the center of the annuli. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))inner_radius (
DistanceSpec
, optional) – The inner radii of the annuli. (default: Field(field=’inner_radius’, transform=Unspecified, units=Unspecified))outer_radius (
DistanceSpec
, optional) – The outer radii of the annuli. (default: Field(field=’outer_radius’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the annuli. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the annuli. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the annuli. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the annuli. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the annuli. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the annuli.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the annuli. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the annuli. (default: 1.0)inner_radius_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the annuli. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the annuli. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the annuli. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the annuli. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the annuli. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the annuli. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the annuli. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
outer_radius_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.annulus(x=[1, 2, 3], y=[1, 2, 3], color="#7FC97F", inner_radius=0.2, outer_radius=0.5) show(plot)
- apply_theme(property_values: dict[str, Any]) None #
Apply a set of theme values which will be used rather than defaults, but will not override application-set values.
The passed-in dictionary may be kept around as-is and shared with other instances to save memory (so neither the caller nor the
HasProps
instance should modify it).- Parameters:
property_values (dict) – theme values to use in place of defaults
- Returns:
None
- arc(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), radius=Field(field='radius', transform=Unspecified, units=Unspecified), start_angle=Field(field='start_angle', transform=Unspecified, units=Unspecified), end_angle=Field(field='end_angle', transform=Unspecified, units=Unspecified), direction='anticlock', *, decorations=[], end_angle_units='rad', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, radius_units='data', start_angle_units='rad', syncable=True, tags=[], **kwargs)#
Configure and add
Arc
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the center of the arcs. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the center of the arcs. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))radius (
DistanceSpec
, optional) – Radius of the arc. (default: Field(field=’radius’, transform=Unspecified, units=Unspecified))start_angle (
AngleSpec
, optional) – The angles to start the arcs, as measured from the horizontal. (default: Field(field=’start_angle’, transform=Unspecified, units=Unspecified))end_angle (
AngleSpec
, optional) – The angles to end the arcs, as measured from the horizontal. (default: Field(field=’end_angle’, transform=Unspecified, units=Unspecified))direction (
Enum
(Direction
), optional) – Which direction to stroke between the start and end angles. (default: ‘anticlock’)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
end_angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the arcs. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the arcs. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the arcs. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the arcs. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the arcs. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the arcs. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the arcs. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
radius_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)start_angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
- asterisk(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.asterisk(x=[1,2,3], y=[1,2,3], size=20, color="#F0027F") show(plot)
- bezier(x0=Field(field='x0', transform=Unspecified, units=Unspecified), y0=Field(field='y0', transform=Unspecified, units=Unspecified), x1=Field(field='x1', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), cx0=Field(field='cx0', transform=Unspecified, units=Unspecified), cy0=Field(field='cy0', transform=Unspecified, units=Unspecified), cx1=Field(field='cx1', transform=Unspecified, units=Unspecified), cy1=Field(field='cy1', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Bezier
glyphs to this figure.- Parameters:
x0 (
NumberSpec
, optional) – The x-coordinates of the starting points. (default: Field(field=’x0’, transform=Unspecified, units=Unspecified))y0 (
NumberSpec
, optional) – The y-coordinates of the starting points. (default: Field(field=’y0’, transform=Unspecified, units=Unspecified))x1 (
NumberSpec
, optional) – The x-coordinates of the ending points. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))y1 (
NumberSpec
, optional) – The y-coordinates of the ending points. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))cx0 (
NumberSpec
, optional) – The x-coordinates of first control points. (default: Field(field=’cx0’, transform=Unspecified, units=Unspecified))cy0 (
NumberSpec
, optional) – The y-coordinates of first control points. (default: Field(field=’cy0’, transform=Unspecified, units=Unspecified))cx1 (
NumberSpec
, optional) – The x-coordinates of second control points. (default: Field(field=’cx1’, transform=Unspecified, units=Unspecified))cy1 (
NumberSpec
, optional) – The y-coordinates of second control points. (default: Field(field=’cy1’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
AlphaSpec
, optional) – The line alpha values for the Bezier curves. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the Bezier curves. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the Bezier curves. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the Bezier curves. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the Bezier curves. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the Bezier curves. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the Bezier curves. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
- block(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), width=1, height=1, *, border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, height_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], width_units='data', **kwargs)#
Configure and add
Block
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the centers of the blocks. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the centers of the blocks. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))width (
DistanceSpec
, optional) – The widths of the blocks. (default: 1)height (
DistanceSpec
, optional) – The heights of the blocks. (default: 1)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners.
Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the blocks. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the blocks. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the blocks. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the blocks. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the blocks. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the blocks.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the blocks. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the blocks. (default: 1.0)height_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the blocks. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the blocks. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the blocks. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the blocks. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the blocks. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the blocks. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the blocks. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
width_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.block(x=[1, 2, 3], y=[1,2,3], width=0.5, height=1, , color="#CAB2D6") show(plot)
- circle(*args: Any, **kwargs: Any) GlyphRenderer #
Configure and add
Circle
glyphs to this figure.- 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
radius (str or list[float]) – values or field names of radii in data units
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 toColumnDataSource
if needed. If none is supplied, one is created for the user automatically.**kwargs – line properties and fill properties
Examples
from bokeh.plotting import figure, show plot = figure(width=300, height=300) plot.circle(x=[1, 2, 3], y=[1, 2, 3], radius=0.2) show(plot)
- circle_cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.circle_cross(x=[1,2,3], y=[4,5,6], size=20, color="#FB8072", fill_alpha=0.2, line_width=2) show(plot)
- circle_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.circle_dot(x=[1,2,3], y=[4,5,6], size=20, color="#FB8072", fill_color=None) show(plot)
- circle_x(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.circle_x(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DD1C77", fill_alpha=0.2) show(plot)
- circle_y(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.circle_y(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DD1C77", fill_alpha=0.2) show(plot)
- clone(**overrides: Any) Self #
Duplicate a
HasProps
object.This creates a shallow clone of the original model, i.e. any mutable containers or child models will not be duplicated. Allows to override particular properties while cloning.
- column(col, gridplot)#
Return whether this plot is in a given column of a GridPlot.
- cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.cross(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#E6550D", line_width=2) show(plot)
- dash(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.dash(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25], color="#99D594", line_width=2) show(plot)
- classmethod dataspecs() dict[str, DataSpec] #
Collect the names of all
DataSpec
properties on this class.This method always traverses the class hierarchy and includes properties defined on any parent classes.
- classmethod descriptors() list[PropertyDescriptor[Any]] #
List of property descriptors in the order of definition.
- diamond(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.diamond(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#1C9099", line_width=2) show(plot)
- diamond_cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.diamond_cross(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#386CB0", fill_color=None, line_width=2) show(plot)
- diamond_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.diamond_dot(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#386CB0", fill_color=None) show(plot)
- dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.dot(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#386CB0") show(plot)
- ellipse(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), width=Field(field='width', transform=Unspecified, units=Unspecified), height=Field(field='height', transform=Unspecified, units=Unspecified), angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, height_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], width_units='data', **kwargs)#
Configure and add
Ellipse
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the centers of the ellipses. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the centers of the ellipses. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))width (
DistanceSpec
, optional) – The widths of each ellipse. (default: Field(field=’width’, transform=Unspecified, units=Unspecified))height (
DistanceSpec
, optional) – The heights of each ellipse. (default: Field(field=’height’, transform=Unspecified, units=Unspecified))angle (
AngleSpec
) – The angle the ellipses are rotated from horizontal. [rad] (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the ellipses. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the ellipses. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the ellipses. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the ellipses. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the ellipses. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the ellipses.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the ellipses. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the ellipses. (default: 1.0)height_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the ellipses. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the ellipses. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the ellipses. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the ellipses. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the ellipses. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the ellipses. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the ellipses. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
width_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.ellipse(x=[1, 2, 3], y=[1, 2, 3], width=30, height=20, color="#386CB0", fill_color=None, line_width=2) show(plot)
- equals(other: HasProps) bool #
Structural equality of models.
- Parameters:
other (HasProps) – the other instance to compare to
- Returns:
True, if properties are structurally equal, otherwise False
- harea(x1=Field(field='x1', transform=Unspecified, units=Unspecified), x2=Field(field='x2', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
HArea
glyphs to this figure.- Parameters:
x1 (
NumberSpec
, optional) – The x-coordinates for the points of one side of the area. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))x2 (
NumberSpec
, optional) – The x-coordinates for the points of the other side of the area. (default: Field(field=’x2’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates for the points of the area. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
Alpha
, optional) – The fill alpha values for the horizontal directed area. (default: 1.0)fill_color (
Nullable
(Color
), optional) – The fill color values for the horizontal directed area. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the horizontal directed area. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the horizontal directed area. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the horizontal directed area. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the horizontal directed area.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the horizontal directed area. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the horizontal directed area. (default: 1.0)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.harea(x1=[0, 0, 0], x2=[1, 4, 2], y=[1, 2, 3], fill_color="#99D594") show(plot)
- harea_step(x1=Field(field='x1', transform=Unspecified, units=Unspecified), x2=Field(field='x2', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, name=None, step_mode='before', syncable=True, tags=[], **kwargs)#
Configure and add
HAreaStep
glyphs to this figure.- Parameters:
x1 (
NumberSpec
, optional) – The x-coordinates for the points of one side of the area. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))x2 (
NumberSpec
, optional) – The x-coordinates for the points of the other side of the area. (default: Field(field=’x2’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates for the points of the area. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
Alpha
, optional) – The fill alpha values for the horizontal directed area. (default: 1.0)fill_color (
Nullable
(Color
), optional) – The fill color values for the horizontal directed area. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the horizontal directed area. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the horizontal directed area. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the horizontal directed area. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the horizontal directed area.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the horizontal directed area. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the horizontal directed area. (default: 1.0)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
step_mode (
Enum
(StepMode
), optional) –Where the step “level” should be drawn in relation to the x and y coordinates. The parameter can assume one of three values:
before
: (default) Draw step levels before each y-coordinate (no step before the first point)after
: Draw step levels after each y-coordinate (no step after the last point)center
: Draw step levels centered on each y-coordinate (default: ‘before’)
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.harea_step(x1=[1, 2, 3], x2=[0, 0, 0], y=[1, 4, 2], step_mode="after", fill_color="#99D594") show(plot)
- hbar(y=Field(field='y', transform=Unspecified, units=Unspecified), height=1, right=Field(field='right', transform=Unspecified, units=Unspecified), left=0, *, border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, height_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
HBar
glyphs to this figure.- Parameters:
y (
NumberSpec
, optional) – The y-coordinates of the centers of the horizontal bars. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))height (
DistanceSpec
, optional) – The heights of the vertical bars. (default: 1)right (
NumberSpec
, optional) – The x-coordinates of the right edges. (default: Field(field=’right’, transform=Unspecified, units=Unspecified))left (
NumberSpec
) – The x-coordinates of the left edges. (default: 0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners.
Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the horizontal bars. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the horizontal bars. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the horizontal bars. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the horizontal bars. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the horizontal bars. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the horizontal bars.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the horizontal bars. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the horizontal bars. (default: 1.0)height_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the horizontal bars. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the horizontal bars. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the horizontal bars. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the horizontal bars. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the horizontal bars. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the horizontal bars. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the horizontal bars. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.hbar(y=[1, 2, 3], height=0.5, left=0, right=[1,2,3], color="#CAB2D6") show(plot)
- hex(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.hex(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1") show(plot)
- hex_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.hex_dot(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1", fill_color=None) show(plot)
- hex_tile(q=Field(field='q', transform=Unspecified, units=Unspecified), r=Field(field='r', transform=Unspecified, units=Unspecified), *, aspect_scale=1.0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color=None, line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, orientation='pointytop', scale=1.0, size=1.0, syncable=True, tags=[], **kwargs)#
Configure and add
HexTile
glyphs to this figure.- Parameters:
q (
NumberSpec
, optional) – The “column” axial coordinates of the tile centers. (default: Field(field=’q’, transform=Unspecified, units=Unspecified))r (
NumberSpec
, optional) – The “row” axial coordinates of the tile centers. (default: Field(field=’r’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
aspect_scale (
Float
, optional) –Match a plot’s aspect ratio scaling.
Use this parameter to match the aspect ratio scaling of a plot when using
aspect_scale
with a value other than1.0
. (default: 1.0)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the hex tiles. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the hex tiles. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the hex tiles. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the hex tiles. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the hex tiles. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the hex tiles.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the hex tiles. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the hex tiles. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the hex tiles. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the hex tiles. (default: ‘butt’)line_color (
ColorSpec
) – The line color values for the hex tiles.line_dash (
DashPatternSpec
) – The line dash values for the hex tiles. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the hex tiles. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the hex tiles. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the hex tiles. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
orientation (
String
, optional) –The orientation of the hex tiles.
Use
"pointytop"
to orient the tile so that a pointed corner is at the top. Use"flattop"
to orient the tile so that a flat side is at the top. (default: ‘pointytop’)scale (
NumberSpec
, optional) – A scale factor for individual tiles. (default: 1.0)size (
Float
, optional) –The radius (in data units) of the hex tiling.
The radius is always measured along the cartesian y-axis for “pointy_top” orientation, and along the cartesian x-axis for “flat_top” orientation. If the aspect ratio of the underlying cartesian system is not 1-1, then the tiles may be “squished” in one direction. To ensure that the tiles are always regular hexagons, consider setting the
match_aspect
property of the plot to True. (default: 1.0)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300, match_aspect=True) plot.hex_tile(r=[0, 0, 1], q=[1, 2, 2], fill_color="#74ADD1") show(plot)
- hold(*, render: bool) Generator[None, None, None] #
Takes care of turning a property on and off within a scope.
- Parameters:
render (bool) – Turns the property hold_render on and off.
- hspan(y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
HSpan
glyphs to this figure.- Parameters:
y (
NumberSpec
, optional) – The y-coordinates of the spans. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
AlphaSpec
, optional) – The line alpha values for the spans. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the spans. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the spans. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the spans. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the spans. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the spans. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the spans. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300, x_range=(0, 1)) plot.hspan(y=[1, 2, 3], color="#CAB2D6") show(plot)
- hstrip(y0=Field(field='y0', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
HStrip
glyphs to this figure.- Parameters:
y0 (
NumberSpec
, optional) – The y-coordinates of the coordinates of one side of the strips. (default: Field(field=’y0’, transform=Unspecified, units=Unspecified))y1 (
NumberSpec
, optional) – The y-coordinates of the coordinates of the other side of the strips. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the strips. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the strips. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the strips. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the strips. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the strips. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the strips.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the strips. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the strips. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the strips. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the strips. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the strips. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the strips. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the strips. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the strips. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the strips. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300, x_range=(0, 1)) plot.hstrip(y0=[1, 2, 5], y1=[3, 4, 8], color="#CAB2D6") show(plot)
- image(image=Field(field='image', transform=Unspecified, units=Unspecified), x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), dw=Field(field='dw', transform=Unspecified, units=Unspecified), dh=Field(field='dh', transform=Unspecified, units=Unspecified), dilate=False, *, anchor='bottom_left', color_mapper=<Instance: LinearColorMapper(palette=Greys9)>, decorations=[], dh_units='data', dw_units='data', global_alpha=1.0, name=None, origin='bottom_left', palette, syncable=True, tags=[], **kwargs)#
Configure and add
Image
glyphs to this figure.- Parameters:
image (
NumberSpec
, optional) – The arrays of scalar data for the images to be colormapped. (default: Field(field=’image’, transform=Unspecified, units=Unspecified))x (
NumberSpec
, optional) – The x-coordinates to locate the image anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to locate the image anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))dw (
DistanceSpec
, optional) –The widths of the plot regions that the images will occupy.
Note
This is not the number of pixels that an image is wide. That number is fixed by the image itself. (default: Field(field=’dw’, transform=Unspecified, units=Unspecified))
dh (
DistanceSpec
, optional) –The height of the plot region that the image will occupy.
Note
This is not the number of pixels that an image is tall. That number is fixed by the image itself. (default: Field(field=’dh’, transform=Unspecified, units=Unspecified))
dilate (
Bool
) –Whether to always round fractional pixel locations in such a way as to make the images bigger.
This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush. (default: False)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
Either
(Enum
(Anchor
),Tuple
(Either
(Enum
(Align
),Enum
(HAlign
),Percent
),Either
(Enum
(Align
),Enum
(VAlign
),Percent
))), optional) – Position of the image should be anchored at the x, y coordinates. (default: ‘bottom_left’)color_mapper (
Instance
(ColorMapper
), optional) –A
ColorMapper
to use to map the scalar data fromimage
into RGBA values for display.The name of a palette from
bokeh.palettes
may also be set, in which case aLinearColorMapper
configured with the named palette wil be used.Note
The color mapping step happens on the client. (default: <Instance: LinearColorMapper(palette=Greys9)>)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
dh_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)dw_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)global_alpha (
AlphaSpec
, optional) – The global alpha values for the images. (default: 1.0)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.
origin (
Enum
(ImageOrigin
), optional) – Defines the coordinate space of an image. (default: ‘bottom_left’)from (a palette to construct a value for the color mapper property)
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Note
If both
palette
andcolor_mapper
are passed, aValueError
exception will be raised. If neither is passed, then theGreys9
palette will be used as a default.
- image_rgba(image=Field(field='image', transform=Unspecified, units=Unspecified), x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), dw=Field(field='dw', transform=Unspecified, units=Unspecified), dh=Field(field='dh', transform=Unspecified, units=Unspecified), dilate=False, *, anchor='bottom_left', decorations=[], dh_units='data', dw_units='data', global_alpha=1.0, name=None, origin='bottom_left', syncable=True, tags=[], **kwargs)#
Configure and add
ImageRGBA
glyphs to this figure.- Parameters:
image (
NumberSpec
, optional) – The arrays of RGBA data for the images. (default: Field(field=’image’, transform=Unspecified, units=Unspecified))x (
NumberSpec
, optional) – The x-coordinates to locate the image anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to locate the image anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))dw (
DistanceSpec
, optional) –The widths of the plot regions that the images will occupy.
Note
This is not the number of pixels that an image is wide. That number is fixed by the image itself. (default: Field(field=’dw’, transform=Unspecified, units=Unspecified))
dh (
DistanceSpec
, optional) –The height of the plot region that the image will occupy.
Note
This is not the number of pixels that an image is tall. That number is fixed by the image itself. (default: Field(field=’dh’, transform=Unspecified, units=Unspecified))
dilate (
Bool
) –Whether to always round fractional pixel locations in such a way as to make the images bigger.
This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush. (default: False)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
Either
(Enum
(Anchor
),Tuple
(Either
(Enum
(Align
),Enum
(HAlign
),Percent
),Either
(Enum
(Align
),Enum
(VAlign
),Percent
))), optional) – Position of the image should be anchored at the x, y coordinates. (default: ‘bottom_left’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
dh_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)dw_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)global_alpha (
AlphaSpec
, optional) – The global alpha values for the images. (default: 1.0)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.
origin (
Enum
(ImageOrigin
), optional) – Defines the coordinate space of an image. (default: ‘bottom_left’)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user 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_stack(image=Field(field='image', transform=Unspecified, units=Unspecified), x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), dw=Field(field='dw', transform=Unspecified, units=Unspecified), dh=Field(field='dh', transform=Unspecified, units=Unspecified), dilate=False, *, anchor='bottom_left', color_mapper=Undefined, decorations=[], dh_units='data', dw_units='data', global_alpha=1.0, name=None, origin='bottom_left', syncable=True, tags=[], **kwargs)#
Configure and add
ImageStack
glyphs to this figure.- Parameters:
image (
NumberSpec
, optional) – The 3D arrays of data for the images. (default: Field(field=’image’, transform=Unspecified, units=Unspecified))x (
NumberSpec
, optional) – The x-coordinates to locate the image anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to locate the image anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))dw (
DistanceSpec
, optional) –The widths of the plot regions that the images will occupy.
Note
This is not the number of pixels that an image is wide. That number is fixed by the image itself. (default: Field(field=’dw’, transform=Unspecified, units=Unspecified))
dh (
DistanceSpec
, optional) –The height of the plot region that the image will occupy.
Note
This is not the number of pixels that an image is tall. That number is fixed by the image itself. (default: Field(field=’dh’, transform=Unspecified, units=Unspecified))
dilate (
Bool
) –Whether to always round fractional pixel locations in such a way as to make the images bigger.
This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush. (default: False)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
Either
(Enum
(Anchor
),Tuple
(Either
(Enum
(Align
),Enum
(HAlign
),Percent
),Either
(Enum
(Align
),Enum
(VAlign
),Percent
))), optional) – Position of the image should be anchored at the x, y coordinates. (default: ‘bottom_left’)color_mapper (
Instance
(StackColorMapper
), optional) –ScalarColorMapper
used to map the scalar data fromimage
into RGBA values for display.Note
The color mapping step happens on the client. (default: Undefined)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
dh_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)dw_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)global_alpha (
AlphaSpec
, optional) – The global alpha values for the images. (default: 1.0)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.
origin (
Enum
(ImageOrigin
), optional) – Defines the coordinate space of an image. (default: ‘bottom_left’)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
- image_url(url, x, y, w, h, angle=0, dilate=False, *, anchor='top_left', angle_units='rad', decorations=[], global_alpha=1.0, h_units='data', name=None, retry_attempts=0, retry_timeout=0, syncable=True, tags=[], w_units='data', **kwargs)#
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 (
NullDistanceSpec
) –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 (
NullDistanceSpec
) –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)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
Either
(Enum
(Anchor
),Tuple
(Either
(Enum
(Align
),Enum
(HAlign
),Percent
),Either
(Enum
(Align
),Enum
(VAlign
),Percent
))), optional) – Position of the image should be anchored at the x, y coordinates. (default: ‘top_left’)angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
global_alpha (
NumberSpec
, 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 (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)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)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
w_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
- inverted_triangle(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.inverted_triangle(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26") show(plot)
- js_link(attr: str, other: Model, other_attr: str, attr_selector: int | str | None = None) None #
Link two Bokeh model properties using JavaScript.
This is a convenience method that simplifies adding a
CustomJS
callback to update one Bokeh model property whenever another changes value.- Parameters:
Added in version 1.1
- Raises:
Examples
This code with
js_link
:select.js_link('value', plot, 'sizing_mode')
is equivalent to the following:
from bokeh.models import CustomJS select.js_on_change('value', CustomJS(args=dict(other=plot), code="other.sizing_mode = this.value" ) )
Additionally, to use attr_selector to attach the left side of a range slider to a plot’s x_range:
range_slider.js_link('value', plot.x_range, 'start', attr_selector=0)
which is equivalent to:
from bokeh.models import CustomJS range_slider.js_on_change('value', CustomJS(args=dict(other=plot.x_range), code="other.start = this.value[0]" ) )
- js_on_change(event: str, *callbacks: JSChangeCallback) None #
Attach a
CustomJS
callback to an arbitrary BokehJS model event.On the BokehJS side, change events for model properties have the form
"change:property_name"
. As a convenience, if the event name passed to this method is also the name of a property on the model, then it will be prefixed with"change:"
automatically:# these two are equivalent source.js_on_change('data', callback) source.js_on_change('change:data', callback)
However, there are other kinds of events that can be useful to respond to, in addition to property change events. For example to run a callback whenever data is streamed to a
ColumnDataSource
, use the"stream"
event on the source:source.js_on_change('streaming', callback)
- line(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Line
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates for the points of the line. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates for the points of the line. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
Alpha
, 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 (
Nullable
(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)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show p = figure(title="line", width=300, height=300) p.line(x=[1, 2, 3, 4, 5], y=[6, 7, 2, 4, 5]) show(p)
- classmethod lookup(name: str, *, raises: bool = True) PropertyDescriptor[Any] | None #
Find the
PropertyDescriptor
for a Bokeh property on a class, given the property name.- Parameters:
- Returns:
descriptor for property named
name
- Return type:
- mathml(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), text=Field(field='text', transform=Unspecified, units=Unspecified), angle=0, x_offset=0, y_offset=0, *, anchor=Value(value='auto', transform=Unspecified, units=Unspecified), angle_units='rad', background_fill_alpha=1.0, background_fill_color=None, background_hatch_alpha=1.0, background_hatch_color=None, background_hatch_extra={}, background_hatch_pattern=None, background_hatch_scale=12.0, background_hatch_weight=1.0, border_line_alpha=1.0, border_line_cap='butt', border_line_color=None, border_line_dash=[], border_line_dash_offset=0, border_line_join='bevel', border_line_width=1, border_radius=0, decorations=[], name=None, outline_shape='box', padding=0, syncable=True, tags=[], text_align='left', text_alpha=1.0, text_baseline='bottom', text_color='#444444', text_font=Value(value='helvetica', transform=Unspecified, units=Unspecified), text_font_size=Value(value='16px', transform=Unspecified, units=Unspecified), text_font_style='normal', text_line_height=1.2, text_outline_color=None, **kwargs)#
Configure and add
MathMLGlyph
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates to locate the text anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to locate the text anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))text (
StringSpec
, optional) – The text values to render. (default: Field(field=’text’, transform=Unspecified, units=Unspecified))angle (
AngleSpec
) – The angles to rotate the text, as measured from the horizontal. (default: 0)x_offset (
NumberSpec
) –Offset values in pixels 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 in pixels 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)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
DataSpec
, optional) –Position within the bounding box of this glyph to which
x
andy
coordinates are anchored to. This can be a named anchor point liketop_left
orcenter
, or a percentage from from left to right and top to bottom, or a combination of those, independently in width and height. If set toauto
, then anchor point will be determined from textalign
andbaseline
.Note
This property is experimental and may change at any point. (default: Value(value=’auto’, transform=Unspecified, units=Unspecified))
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)background_fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the text bounding box. (default: 1.0)background_fill_color (
ColorSpec
) – The fill color values for the text bounding box.background_hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the text bounding box. (default: 1.0)background_hatch_color (
ColorSpec
) – The hatch color values for the text bounding box.background_hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the text bounding box. (default: {})background_hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the text bounding box.background_hatch_scale (
NumberSpec
, optional) – The hatch scale values for the text bounding box. (default: 12.0)background_hatch_weight (
NumberSpec
, optional) – The hatch weight values for the text bounding box. (default: 1.0)border_line_alpha (
AlphaSpec
, optional) – The line alpha values for the text bounding box. (default: 1.0)border_line_cap (
LineCapSpec
, optional) – The line cap values for the text bounding box. (default: ‘butt’)border_line_color (
ColorSpec
) – The line color values for the text bounding box.border_line_dash (
DashPatternSpec
) – The line dash values for the text bounding box. (default: [])border_line_dash_offset (
IntSpec
) – The line dash offset values for the text bounding box. (default: 0)border_line_join (
LineJoinSpec
, optional) – The line join values for the text bounding box. (default: ‘bevel’)border_line_width (
NumberSpec
, optional) – The line width values for the text bounding box. (default: 1)border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners. For the best results, it should be used in combination with
padding
.Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
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.
outline_shape (
DataSpec
, optional) –Specify the shape of the outline for the text box.
The default outline is of a text box is its bounding box (or rectangle). This can be changed to a selection of pre-defined shapes, like circle, ellipse, diamond, parallelogram, etc. Those shapes are circumscribed onto the bounding box, so that the contents of a box fit inside those shapes.
This property is in effect only when either border line, background fill and/or background hatch properties are set. The user can choose
"none"
to avoid drawing any shape, even if border or background visuals are set.Note
This property is experimental and may change at any point.
Note
Currently hit testing only uses the bounding box of text contents of the glyph, which is equivalent to using box/rectangle shape. (default: ‘box’)
padding (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
),Struct
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Extra space between the text of a glyphs and its bounding box (border).
Note
This property is experimental and may change at any point. (default: 0)
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
text_align (
TextAlignSpec
, optional) – The text align values for the text. (default: ‘left’)text_alpha (
AlphaSpec
, optional) – The text alpha values for the text. (default: 1.0)text_baseline (
TextBaselineSpec
, 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 (
StringSpec
, optional) – The text font values for the text. (default: Value(value=’helvetica’, transform=Unspecified, units=Unspecified))text_font_size (
FontSizeSpec
, optional) – The text font size values for the text. (default: Value(value=’16px’, transform=Unspecified, units=Unspecified))text_font_style (
FontStyleSpec
, optional) – The text font style values for the text. (default: ‘normal’)text_line_height (
NumberSpec
, optional) – The text line height values for the text. (default: 1.2)text_outline_color (
ColorSpec
) – The text outline color values for the text.
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, show p = figure(width=300, height=300) p.mathml(x=[0], y=[0], text=[''' <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </math> ''']) show(p)
- multi_line(xs=Field(field='xs', transform=Unspecified, units=Unspecified), ys=Field(field='ys', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
MultiLine
glyphs to this figure.- Parameters:
xs (
NumberSpec
, optional) – The x-coordinates for all the lines, given as a “list of lists”. (default: Field(field=’xs’, transform=Unspecified, units=Unspecified))ys (
NumberSpec
, optional) – The y-coordinates for all the lines, given as a “list of lists”. (default: Field(field=’ys’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
AlphaSpec
, optional) – The line alpha values for the lines. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the lines. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the lines. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the lines. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the lines. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user 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(width=300, 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=Field(field='xs', transform=Unspecified, units=Unspecified), ys=Field(field='ys', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
MultiPolygons
glyphs to this figure.- Parameters:
xs (
NumberSpec
, optional) –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 ofn
Polygons. Each Polygon is made of one exterior ring optionally followed bym
interior rings (holes). (default: Field(field=’xs’, transform=Unspecified, units=Unspecified))ys (
NumberSpec
, optional) –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 ofn
Polygons. Each Polygon is made of one exterior ring optionally followed bym
interior rings (holes). (default: Field(field=’ys’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the multipolygons. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the multipolygons. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the multipolygons. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the multipolygons. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the multipolygons. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the multipolygons.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the multipolygons. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the multipolygons. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the multipolygons. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the multipolygons. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the multipolygons. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the multipolygons. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the multipolygons. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user 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(width=300, 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)
- on_change(attr: str, *callbacks: PropertyCallback) None #
Add a callback on this object to trigger when
attr
changes.- Parameters:
attr (str) – an attribute name on this object
*callbacks (callable) – callback functions to register
- Returns:
None
Examples
widget.on_change('value', callback1, callback2, ..., callback_n)
- on_event(event: str | type[Event], *callbacks: Callable[[Event], None] | Callable[[], None]) None #
Run callbacks when the specified event occurs on this Model
Not all Events are supported for all Models. See specific Events in bokeh.events for more information on which Models are able to trigger them.
- classmethod parameters() list[Parameter] #
Generate Python
Parameter
values suitable for functions that are derived from the glyph.- Returns:
list(Parameter)
- patch(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Patch
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) –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. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))
y (
NumberSpec
, optional) –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. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
Alpha
, optional) – The fill alpha values for the patch. (default: 1.0)fill_color (
Nullable
(Color
), optional) – The fill color values for the patch. (default: ‘gray’)hatch_alpha (
Alpha
, optional) – The hatch alpha values for the patch. (default: 1.0)hatch_color (
Nullable
(Color
), optional) – The hatch color values for the patch. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the patch. (default: {})hatch_pattern (
Nullable
(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 (
Alpha
, 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 (
Nullable
(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)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show p = figure(width=300, height=300) p.patch(x=[1, 2, 3, 2], y=[6, 7, 2, 2], color="#99d8c9") show(p)
- patches(xs=Field(field='xs', transform=Unspecified, units=Unspecified), ys=Field(field='ys', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Patches
glyphs to this figure.- Parameters:
xs (
NumberSpec
, optional) –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. (default: Field(field=’xs’, transform=Unspecified, units=Unspecified))
ys (
NumberSpec
, optional) –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. (default: Field(field=’ys’, transform=Unspecified, units=Unspecified))
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the patches. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the patches. (default: ‘gray’)hatch_alpha (
AlphaSpec
, 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
(‘bokeh.models.textures.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 (
AlphaSpec
, optional) – The line alpha values for the patches. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the patches. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the patches. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the patches. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the patches. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user 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(width=300, 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=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.plus(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26") show(plot)
- classmethod properties(*, _with_props: bool = False) set[str] | dict[str, Property[Any]] #
Collect the names of properties on this class.
Warning
In a future version of Bokeh, this method will return a dictionary mapping property names to property objects. To future-proof this current usage of this method, wrap the return value in
list
.- Returns:
property names
- classmethod properties_with_refs() dict[str, Property[Any]] #
Collect the names of all properties on this class that also have references.
This method always traverses the class hierarchy and includes properties defined on any parent classes.
- properties_with_values(*, include_defaults: bool = True, include_undefined: bool = False) dict[str, Any] #
Collect a dict mapping property names to their values.
This method always traverses the class hierarchy and includes properties defined on any parent classes.
Non-serializable properties are skipped and property values are in “serialized” format which may be slightly different from the values you would normally read from the properties; the intent of this method is to return the information needed to losslessly reconstitute the object instance.
- quad(left=Field(field='left', transform=Unspecified, units=Unspecified), right=Field(field='right', transform=Unspecified, units=Unspecified), top=Field(field='top', transform=Unspecified, units=Unspecified), bottom=Field(field='bottom', transform=Unspecified, units=Unspecified), *, border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Quad
glyphs to this figure.- Parameters:
left (
NumberSpec
, optional) – The x-coordinates of the left edges. (default: Field(field=’left’, transform=Unspecified, units=Unspecified))right (
NumberSpec
, optional) – The x-coordinates of the right edges. (default: Field(field=’right’, transform=Unspecified, units=Unspecified))top (
NumberSpec
, optional) – The y-coordinates of the top edges. (default: Field(field=’top’, transform=Unspecified, units=Unspecified))bottom (
NumberSpec
, optional) – The y-coordinates of the bottom edges. (default: Field(field=’bottom’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners.
Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the quads. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the quads. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the quads. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the quads. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the quads. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the quads.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the quads. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the quads. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the quads. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the quads. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the quads. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the quads. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the quads. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.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=Field(field='x0', transform=Unspecified, units=Unspecified), y0=Field(field='y0', transform=Unspecified, units=Unspecified), x1=Field(field='x1', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), cx=Field(field='cx', transform=Unspecified, units=Unspecified), cy=Field(field='cy', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Quadratic
glyphs to this figure.- Parameters:
x0 (
NumberSpec
, optional) – The x-coordinates of the starting points. (default: Field(field=’x0’, transform=Unspecified, units=Unspecified))y0 (
NumberSpec
, optional) – The y-coordinates of the starting points. (default: Field(field=’y0’, transform=Unspecified, units=Unspecified))x1 (
NumberSpec
, optional) – The x-coordinates of the ending points. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))y1 (
NumberSpec
, optional) – The y-coordinates of the ending points. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))cx (
NumberSpec
, optional) – The x-coordinates of the control points. (default: Field(field=’cx’, transform=Unspecified, units=Unspecified))cy (
NumberSpec
, optional) – The y-coordinates of the control points. (default: Field(field=’cy’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
AlphaSpec
, optional) – The line alpha values for the parabolas. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the parabolas. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the parabolas. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the parabolas. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the parabolas. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
- query_properties_with_values(query: Callable[[PropertyDescriptor[Any]], bool], *, include_defaults: bool = True, include_undefined: bool = False) dict[str, Any] #
Query the properties values of
HasProps
instances with a predicate.- Parameters:
query (callable) – A callable that accepts property descriptors and returns True or False
include_defaults (bool, optional) – Whether to include properties that have not been explicitly set by a user (default: True)
- Returns:
mapping of property names and values for matching properties
- Return type:
- ray(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), length=0, angle=0, *, angle_units='rad', decorations=[], 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, syncable=True, tags=[], **kwargs)#
Configure and add
Ray
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates to start the rays. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to start the rays. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))length (
DistanceSpec
) – The length to extend the ray. Note that thislength
defaults to data units (measured in the x-direction). (default: 0)angle (
AngleSpec
) – The angles in radians to extend the rays, as measured from the horizontal. (default: 0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
length_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the rays. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the rays. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the rays. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the rays. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the rays. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.ray(x=[1, 2, 3], y=[1, 2, 3], length=45, angle=-0.7, color="#FB8072", line_width=2) show(plot)
- rect(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), width=Field(field='width', transform=Unspecified, units=Unspecified), height=Field(field='height', transform=Unspecified, units=Unspecified), angle=0.0, dilate=False, *, angle_units='rad', border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, height_units='data', line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], width_units='data', **kwargs)#
Configure and add
Rect
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the centers of the rectangles. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the centers of the rectangles. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))width (
DistanceSpec
, optional) – The overall widths of the rectangles. (default: Field(field=’width’, transform=Unspecified, units=Unspecified))height (
DistanceSpec
, optional) – The overall heights of the rectangles. (default: Field(field=’height’, transform=Unspecified, units=Unspecified))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)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners.
Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the rectangles. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the rectangles. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the rectangles. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the rectangles. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the rectangles. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the rectangles.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the rectangles. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the rectangles. (default: 1.0)height_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)line_alpha (
AlphaSpec
, optional) – The line alpha values for the rectangles. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the rectangles. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the rectangles. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the rectangles. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the rectangles. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
width_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.rect(x=[1, 2, 3], y=[1, 2, 3], width=10, height=20, color="#CAB2D6", width_units="screen", height_units="screen") show(plot)
- remove_on_change(attr: str, *callbacks: Callable[[str, Any, Any], None]) None #
Remove a callback from this object
- remove_tools(*tools: Tool) None #
Removes tools from the plot.
- Parameters:
*tools (Tool) – the tools to remove from the Plot
- Returns:
None
- row(row, gridplot)#
Return whether this plot is in a given row of a GridPlot.
- scatter(*args: Any, **kwargs: Any) GlyphRenderer #
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 toColumnDataSource
if needed. If none is supplied, one is created for the user automatically.**kwargs – line 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
Scatter
markers with multiple marker types may be drawn in a different order when using the WebGL output backend. This is an explicit trade-off made in the interests of performance.
- segment(x0=Field(field='x0', transform=Unspecified, units=Unspecified), y0=Field(field='y0', transform=Unspecified, units=Unspecified), x1=Field(field='x1', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Segment
glyphs to this figure.- Parameters:
x0 (
NumberSpec
, optional) – The x-coordinates of the starting points. (default: Field(field=’x0’, transform=Unspecified, units=Unspecified))y0 (
NumberSpec
, optional) – The y-coordinates of the starting points. (default: Field(field=’y0’, transform=Unspecified, units=Unspecified))x1 (
NumberSpec
, optional) – The x-coordinates of the ending points. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))y1 (
NumberSpec
, optional) – The y-coordinates of the ending points. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
AlphaSpec
, optional) – The line alpha values for the segments. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the segments. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the segments. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the segments. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the segments. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.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)
- select(*args, **kwargs)#
Query this object and all of its references for objects that match the given selector.
There are a few different ways to call the
select
method. The most general is to supply a JSON-like query dictionary as the single argument or as keyword arguments:- Parameters:
selector (JSON-like) – some sample text
- Keyword Arguments:
kwargs – query dict key/values as keyword arguments
Additionally, for compatibility with
Model.select
, a selector dict may be passed asselector
keyword argument, in which case the value ofkwargs['selector']
is used for the query.For convenience, queries on just names can be made by supplying the
name
string as the single parameter:- Parameters:
name (str) – the name to query on
Also queries on just type can be made simply by supplying the
Model
subclass as the single parameter:- Parameters:
type (Model) – the type to query on
- Returns:
seq[Model]
Examples
# These three are equivalent p.select(selector={"type": HoverTool}) p.select({"type": HoverTool}) p.select(HoverTool) # These two are also equivalent p.select({"name": "mycircle"}) p.select("mycircle") # Keyword arguments can be supplied in place of selector dict p.select({"name": "foo", "type": HoverTool}) p.select(name="foo", type=HoverTool)
- select_one(selector: SelectorType) Model | None #
Query this object and all of its references for objects that match the given selector. Raises an error if more than one object is found. Returns single matching object, or None if nothing is found :param selector: :type selector: JSON-like
- Returns:
Model
- set_from_json(name: str, value: Any, *, setter: Setter | None = None) None #
Set a property value on this object from JSON.
- Parameters:
name – (str) : name of the attribute to set
json – (JSON-value) : value to set to the attribute to
models (dict or None, optional) –
Mapping of model ids to models (default: None)
This is needed in cases where the attributes to update also have values that have references.
setter (ClientSession or ServerSession or None, optional) –
This is used to prevent “boomerang” updates to Bokeh apps.
In the context of a Bokeh server application, incoming updates to properties will be annotated with the session that is doing the updating. This value is propagated through any subsequent change notifications that the update triggers. The session can compare the event setter to itself, and suppress any updates that originate from itself.
- Returns:
None
- set_select(selector: type[Model] | SelectorType, updates: dict[str, Any]) None #
Update objects that match a given selector with the specified attribute/value updates.
- Parameters:
selector (JSON-like)
updates (dict)
- Returns:
None
- square(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.square(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1") show(plot)
- square_cross(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.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=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.square_dot(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25], color="#7FC97F", fill_color=None) show(plot)
- square_pin(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.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=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.square_x(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25], color="#FDAE6B",fill_color=None, line_width=2) show(plot)
- star(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.star(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#1C9099", line_width=2) show(plot)
- star_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.star_dot(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#386CB0", fill_color=None, line_width=2) show(plot)
- step(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, mode='before', name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Step
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates for the steps. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates for the steps. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
Alpha
, 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 (
Nullable
(Color
), 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 (
Float
, 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’)
An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.step(x=[1, 2, 3, 4, 5], y=[1, 2, 3, 2, 5], color="#FB8072") show(plot)
- tex(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), text=Field(field='text', transform=Unspecified, units=Unspecified), angle=0, x_offset=0, y_offset=0, *, anchor=Value(value='auto', transform=Unspecified, units=Unspecified), angle_units='rad', background_fill_alpha=1.0, background_fill_color=None, background_hatch_alpha=1.0, background_hatch_color=None, background_hatch_extra={}, background_hatch_pattern=None, background_hatch_scale=12.0, background_hatch_weight=1.0, border_line_alpha=1.0, border_line_cap='butt', border_line_color=None, border_line_dash=[], border_line_dash_offset=0, border_line_join='bevel', border_line_width=1, border_radius=0, decorations=[], display='auto', macros={}, name=None, outline_shape='box', padding=0, syncable=True, tags=[], text_align='left', text_alpha=1.0, text_baseline='bottom', text_color='#444444', text_font=Value(value='helvetica', transform=Unspecified, units=Unspecified), text_font_size=Value(value='16px', transform=Unspecified, units=Unspecified), text_font_style='normal', text_line_height=1.2, text_outline_color=None, **kwargs)#
Configure and add
TeXGlyph
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates to locate the text anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to locate the text anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))text (
StringSpec
, optional) – The text values to render. (default: Field(field=’text’, transform=Unspecified, units=Unspecified))angle (
AngleSpec
) – The angles to rotate the text, as measured from the horizontal. (default: 0)x_offset (
NumberSpec
) –Offset values in pixels 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 in pixels 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)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
DataSpec
, optional) –Position within the bounding box of this glyph to which
x
andy
coordinates are anchored to. This can be a named anchor point liketop_left
orcenter
, or a percentage from from left to right and top to bottom, or a combination of those, independently in width and height. If set toauto
, then anchor point will be determined from textalign
andbaseline
.Note
This property is experimental and may change at any point. (default: Value(value=’auto’, transform=Unspecified, units=Unspecified))
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)background_fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the text bounding box. (default: 1.0)background_fill_color (
ColorSpec
) – The fill color values for the text bounding box.background_hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the text bounding box. (default: 1.0)background_hatch_color (
ColorSpec
) – The hatch color values for the text bounding box.background_hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the text bounding box. (default: {})background_hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the text bounding box.background_hatch_scale (
NumberSpec
, optional) – The hatch scale values for the text bounding box. (default: 12.0)background_hatch_weight (
NumberSpec
, optional) – The hatch weight values for the text bounding box. (default: 1.0)border_line_alpha (
AlphaSpec
, optional) – The line alpha values for the text bounding box. (default: 1.0)border_line_cap (
LineCapSpec
, optional) – The line cap values for the text bounding box. (default: ‘butt’)border_line_color (
ColorSpec
) – The line color values for the text bounding box.border_line_dash (
DashPatternSpec
) – The line dash values for the text bounding box. (default: [])border_line_dash_offset (
IntSpec
) – The line dash offset values for the text bounding box. (default: 0)border_line_join (
LineJoinSpec
, optional) – The line join values for the text bounding box. (default: ‘bevel’)border_line_width (
NumberSpec
, optional) – The line width values for the text bounding box. (default: 1)border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners. For the best results, it should be used in combination with
padding
.Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
display (
Either
(Enum
(Enumeration(inline, block, auto))), optional) –Defines how the text is interpreted and what TeX display mode to use.
The following values are allowed:
"auto"
(the default) The text is parsed, requiring TeX delimiters to enclose math content, e.g."$$x^2$$"
orr"\[\frac{x}{y}\]"
. This allows mixed math text and regular text content. TeX display mode is inferred by the parser."block"
The text is taken verbatim and TeX’s block mode is used."inline"
The text is taken verbatim and TeX’s inline mode is used. (default: ‘auto’)
macros (
Dict
(String
,Either
(String
,Tuple
(String
,Int
)))) –User defined TeX macros.
This is a mapping from control sequence names (without leading backslash) to either replacement strings or tuples of a replacement string and a number of arguments.
Example:
TeX(text=r"\R \rightarrow \R^2", macros={"RR": r"{\bf R}"}) (default: {})
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.
outline_shape (
DataSpec
, optional) –Specify the shape of the outline for the text box.
The default outline is of a text box is its bounding box (or rectangle). This can be changed to a selection of pre-defined shapes, like circle, ellipse, diamond, parallelogram, etc. Those shapes are circumscribed onto the bounding box, so that the contents of a box fit inside those shapes.
This property is in effect only when either border line, background fill and/or background hatch properties are set. The user can choose
"none"
to avoid drawing any shape, even if border or background visuals are set.Note
This property is experimental and may change at any point.
Note
Currently hit testing only uses the bounding box of text contents of the glyph, which is equivalent to using box/rectangle shape. (default: ‘box’)
padding (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
),Struct
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Extra space between the text of a glyphs and its bounding box (border).
Note
This property is experimental and may change at any point. (default: 0)
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
text_align (
TextAlignSpec
, optional) – The text align values for the text. (default: ‘left’)text_alpha (
AlphaSpec
, optional) – The text alpha values for the text. (default: 1.0)text_baseline (
TextBaselineSpec
, 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 (
StringSpec
, optional) – The text font values for the text. (default: Value(value=’helvetica’, transform=Unspecified, units=Unspecified))text_font_size (
FontSizeSpec
, optional) – The text font size values for the text. (default: Value(value=’16px’, transform=Unspecified, units=Unspecified))text_font_style (
FontStyleSpec
, optional) – The text font style values for the text. (default: ‘normal’)text_line_height (
NumberSpec
, optional) – The text line height values for the text. (default: 1.2)text_outline_color (
ColorSpec
) – The text outline color values for the text.
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, show p = figure(width=300, height=300) p.tex(x=[0], y=[0], text=["x^2 y^2]) show(p)
- text(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), text=Field(field='text', transform=Unspecified, units=Unspecified), angle=0, x_offset=0, y_offset=0, *, anchor=Value(value='auto', transform=Unspecified, units=Unspecified), angle_units='rad', background_fill_alpha=1.0, background_fill_color=None, background_hatch_alpha=1.0, background_hatch_color=None, background_hatch_extra={}, background_hatch_pattern=None, background_hatch_scale=12.0, background_hatch_weight=1.0, border_line_alpha=1.0, border_line_cap='butt', border_line_color=None, border_line_dash=[], border_line_dash_offset=0, border_line_join='bevel', border_line_width=1, border_radius=0, decorations=[], name=None, outline_shape='box', padding=0, syncable=True, tags=[], text_align='left', text_alpha=1.0, text_baseline='bottom', text_color='#444444', text_font=Value(value='helvetica', transform=Unspecified, units=Unspecified), text_font_size=Value(value='16px', transform=Unspecified, units=Unspecified), text_font_style='normal', text_line_height=1.2, text_outline_color=None, **kwargs)#
Configure and add
Text
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates to locate the text anchors. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates to locate the text anchors. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))text (
StringSpec
, optional) – The text values to render. (default: Field(field=’text’, transform=Unspecified, units=Unspecified))angle (
AngleSpec
) – The angles to rotate the text, as measured from the horizontal. (default: 0)x_offset (
NumberSpec
) –Offset values in pixels 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 in pixels 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)
alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
anchor (
DataSpec
, optional) –Position within the bounding box of this glyph to which
x
andy
coordinates are anchored to. This can be a named anchor point liketop_left
orcenter
, or a percentage from from left to right and top to bottom, or a combination of those, independently in width and height. If set toauto
, then anchor point will be determined from textalign
andbaseline
.Note
This property is experimental and may change at any point. (default: Value(value=’auto’, transform=Unspecified, units=Unspecified))
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)background_fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the text bounding box. (default: 1.0)background_fill_color (
ColorSpec
) – The fill color values for the text bounding box.background_hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the text bounding box. (default: 1.0)background_hatch_color (
ColorSpec
) – The hatch color values for the text bounding box.background_hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the text bounding box. (default: {})background_hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the text bounding box.background_hatch_scale (
NumberSpec
, optional) – The hatch scale values for the text bounding box. (default: 12.0)background_hatch_weight (
NumberSpec
, optional) – The hatch weight values for the text bounding box. (default: 1.0)border_line_alpha (
AlphaSpec
, optional) – The line alpha values for the text bounding box. (default: 1.0)border_line_cap (
LineCapSpec
, optional) – The line cap values for the text bounding box. (default: ‘butt’)border_line_color (
ColorSpec
) – The line color values for the text bounding box.border_line_dash (
DashPatternSpec
) – The line dash values for the text bounding box. (default: [])border_line_dash_offset (
IntSpec
) – The line dash offset values for the text bounding box. (default: 0)border_line_join (
LineJoinSpec
, optional) – The line join values for the text bounding box. (default: ‘bevel’)border_line_width (
NumberSpec
, optional) – The line width values for the text bounding box. (default: 1)border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners. For the best results, it should be used in combination with
padding
.Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
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.
outline_shape (
DataSpec
, optional) –Specify the shape of the outline for the text box.
The default outline is of a text box is its bounding box (or rectangle). This can be changed to a selection of pre-defined shapes, like circle, ellipse, diamond, parallelogram, etc. Those shapes are circumscribed onto the bounding box, so that the contents of a box fit inside those shapes.
This property is in effect only when either border line, background fill and/or background hatch properties are set. The user can choose
"none"
to avoid drawing any shape, even if border or background visuals are set.Note
This property is experimental and may change at any point.
Note
Currently hit testing only uses the bounding box of text contents of the glyph, which is equivalent to using box/rectangle shape. (default: ‘box’)
padding (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
),Struct
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Extra space between the text of a glyphs and its bounding box (border).
Note
This property is experimental and may change at any point. (default: 0)
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
text_align (
TextAlignSpec
, optional) – The text align values for the text. (default: ‘left’)text_alpha (
AlphaSpec
, optional) – The text alpha values for the text. (default: 1.0)text_baseline (
TextBaselineSpec
, 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 (
StringSpec
, optional) – The text font values for the text. (default: Value(value=’helvetica’, transform=Unspecified, units=Unspecified))text_font_size (
FontSizeSpec
, optional) – The text font size values for the text. (default: Value(value=’16px’, transform=Unspecified, units=Unspecified))text_font_style (
FontStyleSpec
, optional) – The text font style values for the text. (default: ‘normal’)text_line_height (
NumberSpec
, optional) – The text line height values for the text. (default: 1.2)text_outline_color (
ColorSpec
) – The text outline color values for the text.
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user 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.
- themed_values() dict[str, Any] | None #
Get any theme-provided overrides.
Results are returned as a dict from property name to value, or
None
if no theme overrides any values for this instance.- Returns:
dict or None
- to_serializable(serializer: Serializer) ObjectRefRep #
Converts this object to a serializable representation.
- triangle(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.triangle(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25], color="#99D594", line_width=2) show(plot)
- triangle_dot(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.triangle_dot(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25], color="#99D594", fill_color=None) show(plot)
- triangle_pin(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.triangle_pin(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25], color="#99D594", line_width=2) show(plot)
- trigger(attr: str, old: Any, new: Any, hint: DocumentPatchedEvent | None = None, setter: Setter | None = None) None #
- update(**kwargs: Any) None #
Updates the object’s properties from the given keyword arguments.
- Returns:
None
Examples
The following are equivalent:
from bokeh.models import Range1d r = Range1d # set properties individually: r.start = 10 r.end = 20 # update properties together: r.update(start=10, end=20)
- varea(x=Field(field='x', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), y2=Field(field='y2', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
VArea
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates for the points of the area. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y1 (
NumberSpec
, optional) – The y-coordinates for the points of one side of the area. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))y2 (
NumberSpec
, optional) – The y-coordinates for the points of the other side of the area. (default: Field(field=’y2’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
Alpha
, optional) – The fill alpha values for the vertical directed area. (default: 1.0)fill_color (
Nullable
(Color
), optional) – The fill color values for the vertical directed area. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the vertical directed area. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the vertical directed area. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the vertical directed area. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the vertical directed area.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the vertical directed area. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the vertical directed area. (default: 1.0)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.varea(x=[1, 2, 3], y1=[0, 0, 0], y2=[1, 4, 2], fill_color="#99D594") show(plot)
- varea_step(x=Field(field='x', transform=Unspecified, units=Unspecified), y1=Field(field='y1', transform=Unspecified, units=Unspecified), y2=Field(field='y2', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, name=None, step_mode='before', syncable=True, tags=[], **kwargs)#
Configure and add
VAreaStep
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates for the points of the area. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y1 (
NumberSpec
, optional) – The y-coordinates for the points of one side of the area. (default: Field(field=’y1’, transform=Unspecified, units=Unspecified))y2 (
NumberSpec
, optional) – The y-coordinates for the points of the other side of the area. (default: Field(field=’y2’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
Alpha
, optional) – The fill alpha values for the vertical directed area. (default: 1.0)fill_color (
Nullable
(Color
), optional) – The fill color values for the vertical directed area. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the vertical directed area. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the vertical directed area. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the vertical directed area. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the vertical directed area.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the vertical directed area. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the vertical directed area. (default: 1.0)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
step_mode (
Enum
(StepMode
), optional) –Where the step “level” should be drawn in relation to the x and y coordinates. The parameter can assume one of three values:
before
: (default) Draw step levels before each 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’)
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.varea_step(x=[1, 2, 3], y1=[0, 0, 0], y2=[1, 4, 2], step_mode="after", fill_color="#99D594") show(plot)
- vbar(x=Field(field='x', transform=Unspecified, units=Unspecified), width=1, top=Field(field='top', transform=Unspecified, units=Unspecified), bottom=0, *, border_radius=0, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], width_units='data', **kwargs)#
Configure and add
VBar
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the centers of the vertical bars. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))width (
DistanceSpec
, optional) – The widths of the vertical bars. (default: 1)top (
NumberSpec
, optional) – The y-coordinates of the top edges. (default: Field(field=’top’, transform=Unspecified, units=Unspecified))bottom (
NumberSpec
) – The y-coordinates of the bottom edges. (default: 0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
border_radius (
Either
(NonNegative
,Tuple
(NonNegative
,NonNegative
,NonNegative
,NonNegative
),Struct
)) –Allows the box to have rounded corners.
Note
This property is experimental and may change at any point. (default: 0)
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the vertical bars. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the vertical bars. (default: ‘gray’)hatch_alpha (
AlphaSpec
, 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
(‘bokeh.models.textures.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 (
AlphaSpec
, optional) – The line alpha values for the vertical bars. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the vertical bars. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the vertical bars. (default: 0)line_join (
LineJoinSpec
, 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)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
width_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.vbar(x=[1, 2, 3], width=0.5, bottom=0, top=[1,2,3], color="#CAB2D6") show(plot)
- vspan(x=Field(field='x', transform=Unspecified, units=Unspecified), *, decorations=[], line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
VSpan
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the spans. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
line_alpha (
AlphaSpec
, optional) – The line alpha values for the spans. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the spans. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the spans. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the spans. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the spans. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the spans. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the spans. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300, y_range=(0, 1)) plot.vspan(x=[1, 2, 3], color="#CAB2D6") show(plot)
- vstrip(x0=Field(field='x0', transform=Unspecified, units=Unspecified), x1=Field(field='x1', transform=Unspecified, units=Unspecified), *, decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
VStrip
glyphs to this figure.- Parameters:
x0 (
NumberSpec
, optional) – The x-coordinates of the coordinates of one side of the strips. (default: Field(field=’x0’, transform=Unspecified, units=Unspecified))x1 (
NumberSpec
, optional) – The x-coordinates of the coordinates of the other side of the strips. (default: Field(field=’x1’, transform=Unspecified, units=Unspecified))alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the strips. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the strips. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the strips. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the strips. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the strips. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the strips.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the strips. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the strips. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the strips. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the strips. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the strips. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the strips. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the strips. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the strips. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the strips. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300, y_range=(0, 1)) plot.vstrip(x0=[1, 2, 5], x1=[3, 4, 8], color="#CAB2D6") show(plot)
- wedge(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), radius=Field(field='radius', transform=Unspecified, units=Unspecified), start_angle=Field(field='start_angle', transform=Unspecified, units=Unspecified), end_angle=Field(field='end_angle', transform=Unspecified, units=Unspecified), direction='anticlock', *, decorations=[], end_angle_units='rad', 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, radius_units='data', start_angle_units='rad', syncable=True, tags=[], **kwargs)#
Configure and add
Wedge
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-coordinates of the points of the wedges. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-coordinates of the points of the wedges. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))radius (
DistanceSpec
, optional) – Radii of the wedges. (default: Field(field=’radius’, transform=Unspecified, units=Unspecified))start_angle (
AngleSpec
, optional) – The angles to start the wedges, as measured from the horizontal. (default: Field(field=’start_angle’, transform=Unspecified, units=Unspecified))end_angle (
AngleSpec
, optional) – The angles to end the wedges, as measured from the horizontal. (default: Field(field=’end_angle’, transform=Unspecified, units=Unspecified))direction (
Enum
(Direction
), optional) – Which direction to stroke between the start and end angles. (default: ‘anticlock’)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
end_angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the wedges. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the wedges. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the wedges. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the wedges. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the wedges. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the wedges.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the wedges. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the wedges. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the wedges. (default: 1.0)line_cap (
LineCapSpec
, 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 (
DashPatternSpec
) – The line dash values for the wedges. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the wedges. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the wedges. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the wedges. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
radius_units (
NotSerialized
(Enum
(SpatialUnits
)), optional) – Units to use for the associated property: screen or data (default: ‘data’)start_angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.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=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.x(x=[1, 2, 3], y=[1, 2, 3], size=[10, 20, 25], color="#fa9fb5") show(plot)
- y(x=Field(field='x', transform=Unspecified, units=Unspecified), y=Field(field='y', transform=Unspecified, units=Unspecified), size=4, angle=0.0, *, angle_units='rad', decorations=[], fill_alpha=1.0, fill_color='gray', hatch_alpha=1.0, hatch_color='black', hatch_extra={}, hatch_pattern=None, hatch_scale=12.0, hatch_weight=1.0, hit_dilation=1.0, line_alpha=1.0, line_cap='butt', line_color='black', line_dash=[], line_dash_offset=0, line_join='bevel', line_width=1, name=None, syncable=True, tags=[], **kwargs)#
Configure and add
Scatter
glyphs to this figure.- Parameters:
x (
NumberSpec
, optional) – The x-axis coordinates for the center of the markers. (default: Field(field=’x’, transform=Unspecified, units=Unspecified))y (
NumberSpec
, optional) – The y-axis coordinates for the center of the markers. (default: Field(field=’y’, transform=Unspecified, units=Unspecified))size (
SizeSpec
, optional) – The size (diameter) values for the markers in screen space units. (default: 4)angle (
AngleSpec
) – The angles to rotate the markers. (default: 0.0)alpha (float, optional) –
An alias to set all alpha keyword arguments at once. (default: None)
Alpha values must be between 0 (fully transparent) and 1 (fully opaque).
Any explicitly set values for
line_alpha
, etc. will override this setting.color (color, optional) –
An alias to set all color keyword arguments at once. (default: None)
See Color properties in the user guide for different options to define colors.
Any explicitly set values for
line_color
, etc. will override this setting.legend_field (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in the browser. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in JavaScript, at the same time the Bokeh content is rendered in the browser. If the data is subsequently updated, the legend will automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_group (str, optional) –
Specify that the glyph should produce multiple legend entries by grouping them in Python. The value of this parameter is the name of a column in the data source that should be used for the grouping.
The grouping is performed in Python, before the Bokeh output is sent to a browser. If the date is subsequently updated, the legend will not automatically re-group.
Note
Only one of
legend_field
,legend_group
, orlegend_label
should be suppliedlegend_label (str, optional) –
Specify that the glyph should produce a single basic legend label in the legend. The legend entry is labeled with the exact text supplied here.
Note
Only one of
legend_field
,legend_group
, orlegend_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 returnedGlyphRender
. This can be done by explicitly creating aGlyph
to use, or more simply by passing e.g.muted_color
, etc. to this glyph function.name (str, optional) –
An optional user-supplied name to attach to the renderer (default: None)
Bokeh does not use this value in any way, but it may be useful for searching a Bokeh document to find a specific model.
source (ColumnDataSource, optional) –
A user-supplied data source. (defatult: None)
If not supplied, Bokeh will automatically construct an internal
ColumnDataSource
with default column names from the coordinates and other arguments that were passed-in as literal list or array values.If supplied, Bokeh will use the supplied data source to derive the glyph. In this case, literal list or arrays may not be used for coordinates or other arguments. Only singular fixed values (e.g.
x=10
) or column names in the data source (e.g.x="time"
) are permitted.view (CDSView, optional) – A view for filtering the data source. (default: None)
visible (bool, optional) – Whether the glyph should be rendered. (default: True)
x_range_name (str, optional) –
The name of an extra range to use for mapping x-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.y_range_name (str, optional) –
The name of an extra range to use for mapping y-coordinates. (default: None)
If not supplied, then the default
y_range
of the plot will be used for coordinate mapping.level (RenderLevel, optional) – Specify the render level order for this glyph.
- Keyword Arguments:
angle_units (
NotSerialized
(Enum
(AngleUnits
)), optional) – Units to use for the associated property: deg, rad, grad or turn (default: ‘rad’)decorations (
List
) –A collection of glyph decorations, e.g. arrow heads.
Use
GlyphRenderer.add_decoration()
for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed.Note
Decorations are only for aiding visual appearance of a glyph, but they don’t participate in hit testing, etc. (default: [])
fill_alpha (
AlphaSpec
, optional) – The fill alpha values for the markers. (default: 1.0)fill_color (
ColorSpec
, optional) – The fill color values for the markers. (default: ‘gray’)hatch_alpha (
AlphaSpec
, optional) – The hatch alpha values for the markers. (default: 1.0)hatch_color (
ColorSpec
, optional) – The hatch color values for the markers. (default: ‘black’)hatch_extra (
Dict
(String
,Instance
(‘bokeh.models.textures.Texture’))) – The hatch extra values for the markers. (default: {})hatch_pattern (
HatchPatternSpec
) – The hatch pattern values for the markers.hatch_scale (
NumberSpec
, optional) – The hatch scale values for the markers. (default: 12.0)hatch_weight (
NumberSpec
, optional) – The hatch weight values for the markers. (default: 1.0)hit_dilation (
Size
, optional) – The factor by which to dilate the hit radius which is responsible for defining the range in which a marker responds to interactions with the Hover and Tap tools. (default: 1.0)line_alpha (
AlphaSpec
, optional) – The line alpha values for the markers. (default: 1.0)line_cap (
LineCapSpec
, optional) – The line cap values for the markers. (default: ‘butt’)line_color (
ColorSpec
, optional) – The line color values for the markers. (default: ‘black’)line_dash (
DashPatternSpec
) – The line dash values for the markers. (default: [])line_dash_offset (
IntSpec
) – The line dash offset values for the markers. (default: 0)line_join (
LineJoinSpec
, optional) – The line join values for the markers. (default: ‘bevel’)line_width (
NumberSpec
, optional) – The line width values for the markers. (default: 1)An arbitrary, user-supplied name for this model.
This name can be useful when querying the document to retrieve specific Bokeh models.
>>> plot.circle([1,2,3], [4,5,6], name="temp") >>> plot.select(name="temp") [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]
Note
No uniqueness guarantees or other conditions are enforced on any names that are provided, nor is the name used directly by Bokeh for any reason.
syncable (
Bool
, optional) –Indicates whether this model should be synchronized back to a Bokeh server when updated in a web browser. Setting to
False
may be useful to reduce network traffic when dealing with frequently updated objects whose updated values we don’t need.Note
Setting this property to
False
will prevent anyon_change()
callbacks on this object from triggering. However, any JS-side callbacks will still work. (default: True)tags (
List
) –An optional list of arbitrary, user-supplied values to attach to this model.
This data can be useful when querying the document to retrieve specific Bokeh models:
>>> r = plot.circle([1,2,3], [4,5,6]) >>> r.tags = ["foo", 10] >>> plot.select(tags=['foo', 10]) [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]
Or simply a convenient way to attach any necessary metadata to a model that can be accessed by
CustomJS
callbacks, etc.Note
No uniqueness guarantees or other conditions are enforced on any tags that are provided, nor are the tags used directly by Bokeh for any reason. (default: [])
It is also possible to set the color and alpha parameters of extra glyphs for selection, nonselection, hover, or muted. To do so, add the relevant prefix to any visual parameter. For example, pass
nonselection_alpha
to set the line and fill alpha for nonselect, orhover_fill_alpha
to set the fill alpha for hover. See the Styling glyphs section of the user guide for full details.- Returns:
GlyphRenderer
Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.y(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26") show(plot)
- property background#
- property coordinates#
- property id: ID#
- property legend#
Splattable list of
Legend
objects.
- property plot#
- property ref: Ref#