Bokeh

Bokeh is a Python library for creating interactive visualizations that render as HTML/JavaScript in web browsers — unlike Matplotlib (which produces static PNG images), Bokeh creates interactive plots with built-in zoom, pan, hover tooltips, and selection tools, supports real-time streaming data updates through its Bokeh server, and can build full data dashboards without requiring any JavaScript knowledge, making it the ideal choice for data scientists who need web-based, interactive visualizations.

What Is Bokeh?

  • Definition: An open-source Python visualization library (pip install bokeh) that generates interactive plots as standalone HTML files or server-backed applications — targeting modern web browsers with JSON-based rendering rather than static image export.
  • The Key Difference: Matplotlib creates rasterized images (.png, .svg). Bokeh creates interactive HTML/JavaScript files. You can zoom into a scatter plot, hover over points to see their values, select a region to filter data — all in the browser with no additional code.
  • Architecture: Bokeh works by converting Python objects into a JSON representation (BokehJS documents), which the browser's JavaScript engine renders. This means plots can be embedded in web pages, Jupyter notebooks, or served as live dashboards.

Core Interactivity

ToolActionUse Case
PanClick and drag to move around the plotExploring large datasets
ZoomScroll wheel or box select to zoomFocus on a specific region
HoverMouse over a point to see its dataInspect individual data points
Tap/SelectClick points to select themLink selections across multiple plots
Lasso SelectDraw freeform region to select pointsIrregular region selection
ResetReturn to original viewQuick navigation

Bokeh Interfaces

InterfaceLevelUse Case
bokeh.plottingMid-level (most common)Standard charts with interactivity
bokeh.modelsLow-levelFull control over every visual element
bokeh.ioOutputSave to HTML file or display in notebook
bokeh.serverApplicationLive dashboards with Python callbacks

Bokeh vs Other Visualization Libraries

FeatureBokehMatplotlibPlotlyAltairSeaborn
OutputHTML/JS (interactive)PNG/SVG (static)HTML/JS (interactive)HTML/JS (interactive)PNG (static, matplotlib-based)
InteractivityBuilt-in (zoom, hover, select)None (static)Built-inBuilt-inNone
StreamingYes (Bokeh server)NoLimitedNoNo
DashboardBokeh serverNoDash frameworkNoNo
Learning CurveModerateLowLowLowVery low
Best ForInteractive dashboards, streamingPublication plotsQuick interactive plotsDeclarative grammarStatistical plots

Bokeh is the Python library for building interactive, browser-based data visualizations — providing built-in zoom, pan, hover, and selection tools without any JavaScript, supporting real-time data streaming through the Bokeh server, and enabling full dashboard applications that connect interactive plots to Python backend logic for live data exploration.

Take bokeh further

Ask the copilot about this term, or have our engineers assess it against your process.