bokeh.plotting
¶
-
figure
(**kwargs)¶ Create a new
Figure
for plotting, and add it to the current document.Returns: Figure
-
class
Figure
(*arg, **kw)¶ A subclass of
Plot
that simplifies plot creation with default axes, grids, tools, etc.-
annular_wedge
(*args, **kwargs)¶ Configure and add AnnularWedge glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates of the center of the annular wedges. (default None)
- y (DataSpecProperty) – The y-coordinates of the center of the annular wedges. (default None)
- inner_radius (UnitsSpecProperty) – The inner radii of the annular wedges. (default None)
- outer_radius (UnitsSpecProperty) – The outer radii of the annular wedges. (default None)
- start_angle (UnitsSpecProperty) – The angles to start the annular wedges, as measured from the horizontal. (default None)
- end_angle (UnitsSpecProperty) – The angles to end the annular wedges, as measured from the horizontal. (default None)
- direction (BasicProperty) – Which direction to stroke between the start and end angles. (default ‘anticlock’)
Keyword Arguments: - end_angle_units (end_angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the annular wedges. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the annular wedges. (default ‘gray’)
- inner_radius_units (inner_radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- line_alpha (DataSpecProperty) – The line alpha values for the annular wedges. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the annular wedges. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the annular wedges. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the annular wedges. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the annular wedges. (default 0)
- line_join (BasicProperty) – The line join values for the annular wedges. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the annular wedges. (default 1)
- name (name:String) – (default None)
- outer_radius_units (outer_radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- start_angle_units (start_angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer
-
annulus
(*args, **kwargs)¶ Configure and add Annulus glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates of the center of the annuli. (default None)
- y (DataSpecProperty) – The y-coordinates of the center of the annuli. (default None)
- inner_radius (UnitsSpecProperty) – The inner radii of the annuli. (default None)
- outer_radius (UnitsSpecProperty) – The outer radii of the annuli. (default None)
Keyword Arguments: - fill_alpha (DataSpecProperty) – The fill alpha values for the annuli. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the annuli. (default ‘gray’)
- inner_radius_units (inner_radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- line_alpha (DataSpecProperty) – The line alpha values for the annuli. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the annuli. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the annuli. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the annuli. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the annuli. (default 0)
- line_join (BasicProperty) – The line join values for the annuli. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the annuli. (default 1)
- name (name:String) – (default None)
- outer_radius_units (outer_radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
arc
(*args, **kwargs)¶ Configure and add Arc glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates of the center of the arcs. (default None)
- y (DataSpecProperty) – The y-coordinates of the center of the arcs. (default None)
- radius (UnitsSpecProperty) – Radius of the arc. (default None)
- start_angle (UnitsSpecProperty) – The angles to start the arcs, as measured from the horizontal. (default None)
- end_angle (UnitsSpecProperty) – The angles to end the arcs, as measured from the horizontal. (default None)
- direction (BasicProperty) – Which direction to stroke between the start and end angles. (default ‘anticlock’)
Keyword Arguments: - end_angle_units (end_angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- line_alpha (DataSpecProperty) – The line alpha values for the arcs. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the arcs. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the arcs. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the arcs. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the arcs. (default 0)
- line_join (BasicProperty) – The line join values for the arcs. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the arcs. (default 1)
- name (name:String) – (default None)
- radius_units (radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- start_angle_units (start_angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer
-
asterisk
(*args, **kwargs)¶ Configure and add Asterisk glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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
(*args, **kwargs)¶ Configure and add Bezier glyphs to this Figure.
Parameters: - x0 (DataSpecProperty) – The x-coordinates of the starting points. (default None)
- y0 (DataSpecProperty) – The y-coordinates of the starting points. (default None)
- x1 (DataSpecProperty) – The x-coordinates of the ending points. (default None)
- y1 (DataSpecProperty) – The y-coordinates of the ending points. (default None)
- cx0 (DataSpecProperty) – The x-coordinates of first control points. (default None)
- cy0 (DataSpecProperty) – The y-coordinates of first control points. (default None)
- cx1 (DataSpecProperty) – The x-coordinates of second control points. (default None)
- cy1 (DataSpecProperty) – The y-coordinates of second control points. (default None)
Keyword Arguments: - line_alpha (DataSpecProperty) – The line alpha values for the Bézier curves. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the Bézier curves. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the Bézier curves. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the Bézier curves. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the Bézier curves. (default 0)
- line_join (BasicProperty) – The line join values for the Bézier curves. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the Bézier curves. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer
-
circle
(*args, **kwargs)¶ Configure and add Circle glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
Keyword Arguments: - angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
- angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- radius (UnitsSpecProperty) – The radius values for circle markers (in “data space” units, by default). (default None)
- radius_dimension (BasicProperty) – What dimension to measure circle radii along. (default ‘x’)
- radius_units (radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Note
Only one of
size
orradius
should be provided. Note thatradius
defaults to data units.Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.circle(x=[1, 2, 3], y=[1, 2, 3], size=20) show(plot)
-
circle_cross
(*args, **kwargs)¶ Configure and add CircleCross glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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_x
(*args, **kwargs)¶ Configure and add CircleX glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
cross
(*args, **kwargs)¶ Configure and add Cross glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
diamond
(*args, **kwargs)¶ Configure and add Diamond glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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
(*args, **kwargs)¶ Configure and add DiamondCross glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
get_class
(view_model_name)¶ Given a __view_model__ name, returns the corresponding class object
-
image
(*args, **kwargs)¶ Configure and add Image glyphs to this Figure.
Parameters: - image (DataSpecProperty) – The arrays of scalar data for the images to be colormapped. (default None)
- x (DataSpecProperty) – The x-coordinates to locate the image anchors. (default None)
- y (DataSpecProperty) – The y-coordinates to locate the image anchors. (default None)
- dw (UnitsSpecProperty) – The widths of the plot regions that the images will occupy. (default None)
- dh (UnitsSpecProperty) – The height of the plot region that the image will occupy. (default None)
- dilate (BasicProperty) – Whether to always round fractional pixel locations in such a way as to make the images bigger. (default False)
Keyword Arguments: - color_mapper (BasicProperty) –
A
ColorMapper
to use to map the scalar data fromimage
into RGBA values for display. (default None) - dh_units (dh_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- dw_units (dw_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer
-
image_rgba
(*args, **kwargs)¶ Configure and add ImageRGBA glyphs to this Figure.
Parameters: - image (DataSpecProperty) – The arrays of RGBA data for the images. (default None)
- x (DataSpecProperty) – The x-coordinates to locate the image anchors. (default None)
- y (DataSpecProperty) – The y-coordinates to locate the image anchors. (default None)
- dw (UnitsSpecProperty) – The widths of the plot regions that the images will occupy. (default None)
- dh (UnitsSpecProperty) – The height of the plot region that the image will occupy. (default None)
- dilate (BasicProperty) – Whether to always round fractional pixel locations in such a way as to make the images bigger. (default False)
Keyword Arguments: - cols (DataSpecProperty) – The numbers of columns in the images (default None)
- dh_units (dh_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- dw_units (dw_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- name (name:String) – (default None)
- rows (DataSpecProperty) – The numbers of rows in the images (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Note
The
image_rgba
method accepts images as a two-dimensional array of RGBA values (encoded as 32-bit integers).
-
image_url
(*args, **kwargs)¶ Configure and add ImageURL glyphs to this Figure.
Parameters: - url (DataSpecProperty) – The URLs to retrieve images from. (default None)
- x (DataSpecProperty) – The x-coordinates to locate the image anchors. (default None)
- y (DataSpecProperty) – The y-coordinates to locate the image anchors. (default None)
- w (UnitsSpecProperty) – The widths of the plot regions that the images will occupy. (default None)
- h (UnitsSpecProperty) – The height of the plot region that the image will occupy. (default None)
- angle (UnitsSpecProperty) – The angles to rotate the images, as measured from the horizontal. (default 0)
- global_alpha (BasicProperty) – An overall opacity that each image is rendered with (in addition to any inherent alpha values in the image itself). (default 1.0)
- dilate (BasicProperty) – Whether to always round fractional pixel locations in such a way as to make the images bigger. (default False)
Keyword Arguments: - anchor (BasicProperty) – What position of the image should be anchored at the x, y coordinates. (default ‘top_left’)
- angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- h_units (h_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- name (name:String) – (default None)
- retry_attempts (BasicProperty) – Number of attempts to retry loading the images from the specified URL. Default is zero. (default 0)
- retry_timeout (BasicProperty) – Timeout (in ms) between retry attempts to load the image from the specified URL. Default is zero ms. (default 0)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
- w_units (w_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer
-
inverted_triangle
(*args, **kwargs)¶ Configure and add InvertedTriangle glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
line
(*args, **kwargs)¶ Configure and add Line glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates for the points of the line. (default None)
- y (DataSpecProperty) – The y-coordinates for the points of the line. (default None)
Keyword Arguments: - line_alpha (DataSpecProperty) – The line alpha values for the line. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the line. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the line. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the line. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the line. (default 0)
- line_join (BasicProperty) – The line join values for the line. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the line. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Examples
from bokeh.plotting import figure, output_file, show p = figure(title="line", plot_width=300, plot_height=300) p.line(x=[1, 2, 3, 4, 5], y=[6, 7, 2, 4, 5]) show(p)
-
multi_line
(*args, **kwargs)¶ Configure and add MultiLine glyphs to this Figure.
Parameters: - xs (DataSpecProperty) – The x-coordinates for all the lines, given as a “list of lists”. (default None)
- ys (DataSpecProperty) – The x-coordinates for all the lines, given as a “list of lists”. (default None)
Keyword Arguments: - line_alpha (DataSpecProperty) – The line alpha values for the lines. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the lines. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the lines. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the lines. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the lines. (default 0)
- line_join (BasicProperty) – The line join values for the lines. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the lines. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Note
For this glyph, the data is not simply an array of scalars, it is an “array of arrays”.
Examples
from bokeh.plotting import figure, output_file, show p = figure(plot_width=300, plot_height=300) p.multi_line(xs=[[1, 2, 3], [2, 3, 4]], ys=[[6, 7, 2], [4, 5, 7]], color=['red','green']) show(p)
-
oval
(*args, **kwargs)¶ Configure and add Oval glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates of the centers of the ovals. (default None)
- y (DataSpecProperty) – The y-coordinates of the centers of the ovals. (default None)
- width (UnitsSpecProperty) – The overall widths of each oval. (default None)
- height (UnitsSpecProperty) – The overall height of each oval. (default None)
- angle (UnitsSpecProperty) – The angle the ovals are rotated from horizontal. [rad] (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the ovals. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the ovals. (default ‘gray’)
- height_units (height_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- line_alpha (DataSpecProperty) – The line alpha values for the ovals. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the ovals. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the ovals. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the ovals. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the ovals. (default 0)
- line_join (BasicProperty) – The line join values for the ovals. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the ovals. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
- width_units (width_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Examples
from bokeh.plotting import figure, output_file, show plot = figure(width=300, height=300) plot.oval(x=[1, 2, 3], y=[1, 2, 3], width=0.2, height=0.4, angle=-0.7, color="#1D91C0") show(plot)
-
patch
(*args, **kwargs)¶ Configure and add Patch glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates for the points of the patch. (default None)
- y (DataSpecProperty) – The y-coordinates for the points of the patch. (default None)
Keyword Arguments: - fill_alpha (DataSpecProperty) – The fill alpha values for the patch. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the patch. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the patch. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the patch. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the patch. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the patch. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the patch. (default 0)
- line_join (BasicProperty) – The line join values for the patch. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the patch. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Examples
from bokeh.plotting import figure, output_file, show p = figure(plot_width=300, plot_height=300) p.patch(x=[1, 2, 3, 2], y=[6, 7, 2, 2], color="#99d8c9") show(p)
-
patches
(*args, **kwargs)¶ Configure and add Patches glyphs to this Figure.
Parameters: - xs (DataSpecProperty) – The x-coordinates for all the patches, given as a “list of lists”. (default None)
- ys (DataSpecProperty) – The y-coordinates for all the patches, given as a “list of lists”. (default None)
Keyword Arguments: - fill_alpha (DataSpecProperty) – The fill alpha values for the patches. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the patches. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the patches. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the patches. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the patches. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the patches. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the patches. (default 0)
- line_join (BasicProperty) – The line join values for the patches. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the patches. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer Note
For this glyph, the data is not simply an array of scalars, it is an “array of arrays”.
Examples
from bokeh.plotting import figure, output_file, show p = figure(plot_width=300, plot_height=300) p.patches(xs=[[1,2,3],[4,5,6,5]], ys=[[1,2,1],[4,5,5,4]], color=["#43a2ca", "#a8ddb5"]) show(p)
-
quad
(*args, **kwargs)¶ Configure and add Quad glyphs to this Figure.
Parameters: - left (DataSpecProperty) – The x-coordinates of the left edges. (default None)
- right (DataSpecProperty) – The x-coordinates of the right edges. (default None)
- top (DataSpecProperty) – The y-coordinates of the top edges. (default None)
- bottom (DataSpecProperty) – The y-coordinates of the bottom edges. (default None)
Keyword Arguments: - fill_alpha (DataSpecProperty) – The fill alpha values for the quads. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the quads. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the quads. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the quads. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the quads. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the quads. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the quads. (default 0)
- line_join (BasicProperty) – The line join values for the quads. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the quads. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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
(*args, **kwargs)¶ Configure and add Quadratic glyphs to this Figure.
Parameters: - x0 (DataSpecProperty) – The x-coordinates of the starting points. (default None)
- y0 (DataSpecProperty) – The y-coordinates of the starting points. (default None)
- x1 (DataSpecProperty) – The x-coordinates of the ending points. (default None)
- y1 (DataSpecProperty) – The y-coordinates of the ending points. (default None)
- cx (DataSpecProperty) – The x-coordinates of the control points. (default None)
- cy (DataSpecProperty) – The y-coordinates of the control points. (default None)
Keyword Arguments: - line_alpha (DataSpecProperty) – The line alpha values for the parabolas. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the parabolas. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the parabolas. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the parabolas. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the parabolas. (default 0)
- line_join (BasicProperty) – The line join values for the parabolas. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the parabolas. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.Returns: GlyphRenderer
-
ray
(*args, **kwargs)¶ Configure and add Ray glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates to start the rays. (default None)
- y (DataSpecProperty) – The y-coordinates to start the rays. (default None)
- length (UnitsSpecProperty) – The length to extend the ray. Note that this
length
defaults to screen units. (default None) - angle (UnitsSpecProperty) – The angles in radians to extend the rays, as measured from the horizontal. (default None)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- length_units (length_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- line_alpha (DataSpecProperty) – The line alpha values for the rays. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the rays. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the rays. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the rays. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the rays. (default 0)
- line_join (BasicProperty) – The line join values for the rays. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the rays. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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
(*args, **kwargs)¶ Configure and add Rect glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates of the centers of the rectangles. (default None)
- y (DataSpecProperty) – The y-coordinates of the centers of the rectangles. (default None)
- width (UnitsSpecProperty) – The overall widths of the rectangles. (default None)
- height (UnitsSpecProperty) – The overall heights of the rectangles. (default None)
- angle (UnitsSpecProperty) – The angles to rotate the rectangles, as measured from the horizontal. (default 0.0)
- dilate (BasicProperty) – Whether to always round fractional pixel locations in such a way as to make the rectangles bigger. (default False)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the rectangles. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the rectangles. (default ‘gray’)
- height_units (height_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- line_alpha (DataSpecProperty) – The line alpha values for the rectangles. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the rectangles. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the rectangles. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the rectangles. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the rectangles. (default 0)
- line_join (BasicProperty) – The line join values for the rectangles. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the rectangles. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
- width_units (width_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
scatter
(*args, **kwargs)¶ 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, optional) – a valid marker_type, defaults to “circle”
- color (color value, optional) – shorthand to set both fill and line color
- source (
ColumnDataSource
) – a user-supplied data source. 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], fill_color="red") >>> p.scatter("data1", "data2", source=data_source, ...)
-
segment
(*args, **kwargs)¶ Configure and add Segment glyphs to this Figure.
Parameters: - x0 (DataSpecProperty) – The x-coordinates of the starting points. (default None)
- y0 (DataSpecProperty) – The y-coordinates of the starting points. (default None)
- x1 (DataSpecProperty) – The x-coordinates of the ending points. (default None)
- y1 (DataSpecProperty) – The y-coordinates of the ending points. (default None)
Keyword Arguments: - line_alpha (DataSpecProperty) – The line alpha values for the segments. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the segments. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the segments. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the segments. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the segments. (default 0)
- line_join (BasicProperty) – The line join values for the segments. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the segments. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
square
(*args, **kwargs)¶ Configure and add Square glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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
(*args, **kwargs)¶ Configure and add SquareCross glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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_x
(*args, **kwargs)¶ Configure and add SquareX glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
text
(*args, **kwargs)¶ Configure and add Text glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates to locate the text anchors. (default None)
- y (DataSpecProperty) – The y-coordinates to locate the text anchors. (default None)
- text (DataSpecProperty) – The text values to render. (default ‘text’)
- angle (UnitsSpecProperty) – The angles to rotate the text, as measured from the horizontal. (default 0)
- x_offset (DataSpecProperty) – Offset values to apply to the x-coordinates. (default 0)
- y_offset (DataSpecProperty) – Offset values to apply to the y-coordinates. (default 0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- text_align (BasicProperty) – The text align values for the text. (default ‘left’)
- text_alpha (DataSpecProperty) – The text alpha values for the text. (default 1.0)
- text_baseline (BasicProperty) – The text baseline values for the text. (default ‘bottom’)
- text_color (DataSpecProperty) – The text color values for the text. (default ‘#444444’)
- text_font (BasicProperty) – The text font values for the text. (default ‘helvetica’)
- text_font_size (DataSpecProperty) – The text font size values for the text. (default {‘value’: ‘12pt’})
- text_font_style (BasicProperty) – The text font style values for the text. (default ‘normal’)
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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.Returns: GlyphRenderer
-
triangle
(*args, **kwargs)¶ Configure and add Triangle glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-
wedge
(*args, **kwargs)¶ Configure and add Wedge glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-coordinates of the points of the wedges. (default None)
- y (DataSpecProperty) – The y-coordinates of the points of the wedges. (default None)
- radius (UnitsSpecProperty) – Radii of the wedges. (default None)
- start_angle (UnitsSpecProperty) – The angles to start the wedges, as measured from the horizontal. (default None)
- end_angle (UnitsSpecProperty) – The angles to end the wedges, as measured from the horizontal. (default None)
- direction (BasicProperty) – Which direction to stroke between the start and end angles. (default ‘anticlock’)
Keyword Arguments: - end_angle_units (end_angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the wedges. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the wedges. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the wedges. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the wedges. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the wedges. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the wedges. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the wedges. (default 0)
- line_join (BasicProperty) – The line join values for the wedges. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the wedges. (default 1)
- name (name:String) – (default None)
- radius_units (radius_units:Enum(‘screen’, ‘data’)) – (default ‘data’)
- start_angle_units (start_angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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
(*args, **kwargs)¶ Configure and add X glyphs to this Figure.
Parameters: - x (DataSpecProperty) – The x-axis coordinates for the center of the markers. (default None)
- y (DataSpecProperty) – The y-axis coordinates for the center of the markers. (default None)
- size (DataSpecProperty) – The size (diameter) values for the markers in screen space units. (default 4)
- angle (UnitsSpecProperty) – The angles to rotate the markers. (default 0.0)
Keyword Arguments: - angle_units (angle_units:Enum(‘deg’, ‘rad’)) – (default ‘rad’)
- fill_alpha (DataSpecProperty) – The fill alpha values for the markers. (default 1.0)
- fill_color (DataSpecProperty) – The fill color values for the markers. (default ‘gray’)
- line_alpha (DataSpecProperty) – The line alpha values for the markers. (default 1.0)
- line_cap (BasicProperty) – The line cap values for the markers. (default ‘butt’)
- line_color (DataSpecProperty) – The line color values for the markers. (default ‘black’)
- line_dash (BasicProperty) – The line dash values for the markers. (default [])
- line_dash_offset (BasicProperty) – The line dash offset values for the markers. (default 0)
- line_join (BasicProperty) – The line join values for the markers. (default ‘miter’)
- line_width (DataSpecProperty) – The line width values for the markers. (default 1)
- name (name:String) – (default None)
- tags (tags:List(Any)) – (default [])
- visible (BasicProperty) – Whether the glyph should render or not. (default True)
Other Parameters: - alpha (float) – an alias to set all alpha keyword args at once
- color (Color) – an alias to set all color keyword args at once
- data_source (ColumnDataSource) – a user supplied data source
- legend (str) – a legend tag for this glyph
- x_range_name (str) – name an extra range to use for mapping x-coordinates
- y_range_name (str) – name an extra range to use for mapping y-coordinates
- level (Enum) – control the render level order for this glyph
It is also possible to set the color and alpha parameters of a “nonselection” glyph. To do so, prefix any visual parameter with
'nonselection_'
. For example, passnonselection_alpha
ornonselection_fill_alpha
.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)
-