Skip to content

Plotting overview

Every plot is a top-level function bv.plot_<type>(...) that returns (fig, ax). They all share the same conventions:

  • Inputs are numpy arrays, or column names when you pass data= (see Data input).
  • Styling comes from an optional spec= (the spec system).
  • Any extra keyword is an override routed to the backend (color=, linewidth=, alpha=, label=, …).
  • hue= / group= split one call into per-category series (Grouping).

The full set

Function Draws Page
plot_line connected line Basic
plot_scatter markers Basic
plot_step step / staircase Basic
plot_bar bars (grouped/stacked) Basic
plot_errorbar points with error bars Basic
plot_fill_between shaded band Basic
plot_violin violin distributions Distributions
plot_hexbin 2D density hexbins Distributions
plot_pie pie chart Distributions
plot_image heatmap / image + colorbar 2D & images
plot_vertical vertical reference lines Annotations
plot_horizontal horizontal reference lines Annotations
plot_pval significance bracket Annotations

Higher-level composed figures (raincloud, lollipop, …) live in Composite plots.

Channels: what each plot expects

behaviz validates inputs declaratively. Each plot declares channels — named, typed inputs (e.g. x is a vector, ys is a list of vectors, err must match y's length). Pass the wrong shape and you get a clear BehavizDataError naming the channel and the fix, not a backend traceback. The required channels for each plot are listed on its page.