Interactive pavement plots

The same API — plot(data) and with_marginals(scatter, x, y, categories) — on every interactive backend. Pick one by importing its submodule.

Plotly

Interactive hover, pan, and zoom. Returns a plain plotly.graph_objects.Figure.

Single pavement

Show code
import pavement.plotly as ppl

ppl.plot([1, 2, 2, 3, 4, 5, 8, 13, 21])

Multiple categories

Show code
ppl.plot(
    [[1,2,3,4,5,6,7,8], [3,4,5,6,7,8,9,12], [2,2,3,5,8,8,9,10]],
    labels=["cats", "dogs", "birds"])

Scatter with pavement marginals

Show code
import plotly.graph_objects as go
import pavement.plotly as ppl

scatter = go.Figure()
for g in groups:
    scatter.add_trace(go.Scatter(x=xs[g], y=ys[g], name=g, ...))
ppl.with_marginals(scatter, x=xs, y=ys, categories=groups)

Bokeh

Interactive hover, pan, and zoom. Returns a plain bokeh.plotting.figure with glyphs and a hover tool.

Single pavement

Show code
import pavement.bokeh as pbk
from bokeh.plotting import show

show(pbk.plot([1, 2, 2, 3, 4, 5, 8, 13, 21], value_label='value'))

Multiple categories

Show code
pbk.plot(
    [[1,2,3,4,5,6,7,8], [3,4,5,6,7,8,9,12], [2,2,3,5,8,8,9,10]],
    labels=["cats", "dogs", "birds"])

Scatter with pavement marginals

Show code
from bokeh.plotting import figure
import pavement.bokeh as pbk

scatter = figure()
for g in groups:
    scatter.scatter(xs[g], ys[g], color=palette[g], name=g)
pbk.with_marginals(scatter, x=xs_all, y=ys_all, categories=groups)

HoloViews

Backend-agnostic: the same definition renders through Bokeh or Plotly. Here rendered via Bokeh.

Single pavement

Show code
import holoviews as hv
import pavement.holoviews as phv

hv.extension('bokeh')
phv.plot([1, 2, 2, 3, 4, 5, 8, 13, 21])

Multiple categories

Show code
phv.plot(
    [[1,2,3,4,5,6,7,8], [3,4,5,6,7,8,9,12], [2,2,3,5,8,8,9,10]],
    labels=["cats", "dogs", "birds"])

Scatter with pavement marginals

Show code
import holoviews as hv
import pavement.holoviews as phv

scatter = hv.NdOverlay({g: hv.Scatter([...]) for g in groups})
phv.with_marginals(scatter, x=xs, y=ys, categories=groups)