bokeh.plotting Interface¶figure(**kwargs)¶Create a new Figure for plotting, and add it to
the current document.
| Returns: | Figure |
|---|
Figure(*arg, **kw)¶A subclass of Plot that simplifies plot
creation with default axes, grids, tools, etc.
annular_wedge(plot, *args, **kwargs)¶Add AnnularWedge glyphs to a Figure.
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
annulus(plot, *args, **kwargs)¶Add Annulus glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
asterisk(plot, *args, **kwargs)¶Add Asterisk glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add Bezier glyphs to a Figure.
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
circle(plot, *args, **kwargs)¶Add Circle glyphs to a Figure.
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
Note
Only one of size or radius should be provided. Note that radius defaults to data units.
Examples
from bokeh.plotting import figure, output_file, show
plot = figure(width=300, height=300)
plot.circle(x=[1, 2, 3], y=[1, 2, 3], size=20)
show(plot)
circle_cross(plot, *args, **kwargs)¶Add CircleCross glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add CircleX glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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)
Error
Unable to generate Bokeh plot at /home/travis/build/bokeh/bokeh/sphinx/source/docs/reference/plotting.rst:252:
non-keyword arg after keyword arg (<string>, line 5)
cross(plot, *args, **kwargs)¶Add Cross glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add Diamond glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add DiamondCross glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶A palette (string name of a built-in palette, currently) must also be supplied to use for color-mapping the scalar image.
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
Note
Setting dilate to True will cause pixel distances (e.g., for dw and dh) to be rounded up, always.
image_rgba(plot, *args, **kwargs)¶Add ImageRGBA glyphs to a Figure.
The image_rgba method accepts images as a two-dimensional array of RGBA values (encoded
as 32-bit integers).
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
Note
Setting dilate to True will cause pixel distances (e.g., for dw and dh) to
be rounded up, always.
image_url(plot, *args, **kwargs)¶Add ImageURL glyphs to a Figure.
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
inverted_triangle(plot, *args, **kwargs)¶Add InvertedTriangle glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add MultiLine glyphs to a Figure.
| Parameters: |
|
|---|
Note
For this glyph, the data is not simply an array of scalars, it is really an “array of arrays”.
| Returns: | GlyphRenderer |
|---|
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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add Patches glyphs to a Figure.
| Parameters: |
|
|---|
Note
For this glyph, the data is not simply an array of scalars, it is really an “array of arrays”.
| Returns: | GlyphRenderer |
|---|
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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add Quadratic glyphs to a Figure.
| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
ray(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| Returns: | GlyphRenderer |
Note
Setting dilate to True will cause pixel distances (e.g., for width and height) to be rounded up, always.
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: |
|
|---|
Examples
>>> p.scatter([1,2,3],[4,5,6], fill_color="red")
>>> p.scatter("data1", "data2", source=data_source, ...)
segment(plot, *args, **kwargs)¶The segment glyph displays line segments with the given starting and ending coordinates.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add Square glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add SquareCross glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add SquareX glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶| Parameters: |
|
|---|
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(plot, *args, **kwargs)¶Add Triangle glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶| Parameters: |
|
|---|---|
| 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(plot, *args, **kwargs)¶Add X glyphs to a Figure.
| Parameters: |
|
|---|---|
| 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)