Plot with glyphs
Plot line, bar, patch and scatter plots.
For more inspiration visit the gallery: https://docs.bokeh.org/en/latest/docs/gallery.html#gallery
We can illustrate the different plots with some simple data
x = [1,3,4,5]
y = [2,6,8,4]
Basic line plot
from bokeh.plotting import figure, output_file, show
output_file("line.html")
p = figure()
p.line(x,y)
show(p)

Basic bar plot
from bokeh.plotting import figure, output_file, show
output_file("bar.html")
p = figure()
p.vbar(x, top = y, color = 'blue', width = 0.5)
show(p)
Use width = 1 if you do not want any separation between the bars.

Basic scatter plot
from bokeh.plotting import figure, output_file, show
output_file("scatter.html")
p = figure()
#plotting points with a circle marker
p.circle(x,y size= 10)
show(p)
Instead of the circle
marker we can use a variety of shapes like asterisk()
. cross()
. diamond()
, triangle()
etc

Last updated
Was this helpful?