Skip to contents

Adds a <qe-trajectories> layer to the rendered graph. QEviz only renders supplied trajectory rows; accumulation, dooring, model selection, and inference remain the caller's responsibility.

Usage

qe_trajectories(
  p,
  units = NULL,
  smooth = c("none", "poly"),
  max_degree = 3L,
  degree_selection = c("loocv_2d", "fixed"),
  points = TRUE,
  tips = TRUE,
  playhead = NULL,
  line_style = c("uniform", "tapered"),
  stroke_width = 2,
  stroke_width_range = c(1, 6),
  opacity_range = c(0.3, 1),
  show = TRUE
)

Arguments

p

A qe_plot object.

units

Optional character vector of unit IDs to show. Omit to show all units present in the model's trajectories frame.

smooth

Path treatment: "none" for observed steps or "poly" for polynomial smoothing.

max_degree

Upper bound on polynomial degree when smooth = "poly". With degree_selection = "loocv_2d" the actual degree is chosen in 1..max_degree; with "fixed" this degree is always used.

degree_selection

Degree selection when smooth = "poly". "loocv_2d" (default) picks the degree by joint 2D leave-one-out cross-validation; "fixed" always uses max_degree. Near-origin points are excluded from the fit (still drawn), matching ena.plot.trajectory().

points

Logical. Show observed state dots.

tips

Logical. Show the leading current-state marker.

playhead

Optional numeric time value. Rows after this value are hidden.

line_style

"uniform" or "tapered".

stroke_width

Uniform stroke width in display pixels.

stroke_width_range

Numeric length-2 vector for tapered paths.

opacity_range

Numeric length-2 vector for tapered paths.

show

Logical. FALSE suppresses trajectory rendering.

Value

The modified qe_plot object.