The same API — plot(data) and
with_marginals(scatter, x, y, categories) — on every interactive
backend. Pick one by importing its submodule.
Interactive hover, pan, and zoom. Returns a plain plotly.graph_objects.Figure.
import pavement.plotly as ppl
ppl.plot([1, 2, 2, 3, 4, 5, 8, 13, 21])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"])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)Interactive hover, pan, and zoom. Returns a plain bokeh.plotting.figure with glyphs and a hover tool.
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'))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"])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)Backend-agnostic: the same definition renders through Bokeh or Plotly. Here rendered via Bokeh.
import holoviews as hv
import pavement.holoviews as phv
hv.extension('bokeh')
phv.plot([1, 2, 2, 3, 4, 5, 8, 13, 21])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"])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)