Rasterize billions of points · HoloViz · verified against Datashader 0.19 (2026)

Datashader cheat sheet

Datashader turns huge datasets into images without overplotting. Instead of drawing a marker per row, it aggregates your data into a fixed pixel grid, then shades that grid into an image — so every pixel is a real, faithful count/mean, and billions of points render in a moment. Three stages: Canvas (aggregate) → optional transform → tf.shade (color). It's not a plotting library itself — pair it with HoloViews/Bokeh for axes and interactivity. This sheet targets Datashader 0.19.

canvas & glyphs reductions shading transfer fns scale & interactive gotcha most common

Verified 2026-08-24 against the official docs at datashader.org (v0.19.1). Part of the HoloViz stack. Works on pandas, Dask (out-of-core), and cuDF (GPU) dataframes with the same API. For interactive zoom, drive it through HoloViews' rasterize/datashade.

Outline

Make a Canvas at your target resolution, aggregate points/lines into a grid with a reduction, then tf.shade it — using how="eq_hist" to reveal structure. Scale with Dask/GPU; go interactive via HoloViews.

Aggregate

  1. 1 · Setup & the pipeline
  2. 2 · Canvas & glyphs
  3. 3 · Reductions (agg)

Shade

  1. 4 · tf.shade & colormaps
  2. 5 · how= & categorical
  3. 6 · spread / stack / bg

Scale & ship

  1. 7 · Dask & GPU
  2. 8 · Interactive (HoloViews)
  3. 9 · Gotchas
  4. Worth memorizing

Aggregate

Bin your data into a fixed pixel grid — the heart of Datashader.

1Setup & the pipeline0.19
2Canvas & glyphsbin into a grid
3Reductions (agg)what each cell holds

Shade

Turn the aggregate grid into a colored image — the step that reveals structure.

4tf.shade & colormapsgrid -> image
5how= & categorical colorreveal the dynamic range
6spread / stack / bgpost-process the image

Scale & ship

Push past memory with Dask/GPU, and add interactivity.

7Dask & GPUbillions of rows
8Interactive (HoloViews)re-aggregate on zoom
!Common gotchasread before shipping

Worth memorizing

aggregate -> transform -> shadeCanvas ... then tf.shade
ds.Canvas(plot_width, plot_height, x_range, y_range)grid = pixels; set the ranges
cvs.points / cvs.line / cvs.rasterglyph = how rows map to cells
agg=ds.count()/mean("v")/sum("v")what each pixel holds
ds.by("cat", ds.count())categorical; needs category dtype
tf.shade(agg, cmap=cc.fire)colorcet for perceptual maps
how="eq_hist"reveals structure across orders of magnitude
color_key={...}color categorical aggregates
tf.spread / dynspreadmake sparse points visible
Dask / cuDF dataframessame API, out-of-core / GPU
rasterize() in HoloViewsre-aggregate on zoom; keeps hover/colorbar
not a plotting libpair with HoloViews/Bokeh for axes