Quick Reference · interactive visualization for the browser

bokeh cheat sheet

Every Bokeh plot is built the same way: attach glyphs (circles, lines, bars) to data on a figure, then output it. Python assembles the objects; BokehJS renders them — and the interactivity — live in the browser. Learn the five steps once and the API stops being a list to memorize.

import / setup figure & styling glyphs (the core) data & transforms interaction output & embed deprecated / gotcha most common

Distilled & cross-checked against Bokeh 3.10.0 (current, re-verified 2026-08-28; Python 3.12+): docs.bokeh.org (User Guide + First Steps) · bokeh.org · DataCamp Bokeh cheat sheet · KDnuggets · Real Python

The five steps — and how Python hands your plot to the browser
THE bokeh.plotting WORKFLOW 1 · Prepare data lists · arrays DataFrame ColumnDataSource 2 · Create figure p = figure(...) title · axes · tools 3 · Add glyphs p.scatter() · p.line() p.vbar() · p.patch() 4 · Choose output output_file() output_notebook() 5 · Show / save show(p) save(p) WHAT ACTUALLY RENDERS IT Bokeh · Python library bokeh.plotting (primary) bokeh.models (low-level) builds a Document of models, validates & serializes it JSON declarative models BokehJS · in the browser renders the visuals to canvas / WebGL handles pan, zoom, hover, selection, legends “We write the JavaScript, so you don't have to.” serialize embed
The whole workflow in ten lines
from bokeh.plotting import figure, show ← 1 · importfrom bokeh.io import output_filex = [1, 2, 3, 4, 5] ← 1 · prepare datay = [6, 7, 2, 4, 5]p = figure(title="Line example", ← 2 · create a figure x_axis_label="x", y_axis_label="y")p.line(x, y, legend_label="Temp.", line_width=2) ← 3 · add a glyph rendereroutput_file("lines.html") ← 4 · choose outputshow(p) ← 5 · show or save
01Setup & Importonce per project
02Create a Figurethe canvas
03Scatter & Markerspoints
04Lines & Curvesconnect points
05Bars, Areas & Wedgesfilled shapes
06Data SourcesColumnDataSource
07Colour Mapping & Transformsbokeh.transform
08Styling & Appearancemake it yours
09Annotationsvisual aids
10Legendslabel your series
11Tools & Toolbarthe interactivity
12Hover & Tooltipsread values
13Linking Plotsmove together
14Layoutsarrange plots
15Widgetscontrols
16Callbacksmake it react
17Output & Saveto a file
18Embedding & Exportinto your app
19Bokeh ServerPython stays live

Four ideas that make the rest click

The vocabulary Bokeh keeps returning to — the core equation, the marker family, where sizes live, and how a tooltip reads your data. Based on the Bokeh user-guide reference figures.

data + glyphs = plot

A glyph is a shape mapped onto columns of data. Add glyphs to a figure and you have a plot.

x y 16 27 32 data + glyphs = plot

the marker family

One scatter() method, many shapes via marker=. A sample of the built-in set.

circle square triangle diamond hex inv_tri plus x asterisk dot star x_dot sq_cross dash cross

size vs radius — where the number lives

size is screen pixels: constant on zoom. circle(radius=) is data units: it grows as you zoom in.

size=20 (screen px) 2× zoom same pixel size ✓ radius=0.5 (data) 2× zoom grows with data ✓

tooltip field syntax

@ reads a column; $ reads a cursor / special value. Braces format the number.

country: @name sales: @rev{$0.0a} at: ($x, $y) reads column "name" cursor pos (data space) { } formats the value

Worth memorizing

width, not plot_widthplot_width/plot_height were renamed in Bokeh 3.0
TabPanel, not Panelnow from bokeh.models import TabPanel, Tabs
legend_label ≠ legendalso legend_field (browser) & legend_group (Python)
scatter() is the wayunified marker method; per-shape methods still work
size vs radiussize = screen px · radius = data units (zooms)
@col vs $x@ reads a column · $ is the cursor / a special value
bokeh.charts is goneno Bar/BoxPlot/Scatter classes — use hvPlot / HoloViews
CustomJS vs on_changeCustomJS = standalone file · on_change = needs a server
CDSView(filter=…)3.0 dropped source= & the filters=[] list
mode="inline"embeds BokehJS so the HTML opens with no internet
one source, many glyphsshared ColumnDataSource → linked hover & brushing
show ≠ saveshow writes + opens · save only writes the file