13A.11 Line, path, step, and area geoms
Trajectory geoms connect observations, so grouping and order are scientific decisions. line orders points by x within each group. path connects rows in their current data order. step orders by x and holds a value until the next x. area fills between y and the baseline across x.
For individual concentration profiles, use group = ID; without it, all subjects can be connected into one meaningless line. Color may show dose or treatment while group keeps trajectories separate. A line plot does not interpolate a pharmacokinetic model—it simply connects displayed observations.
path is useful when source order represents a process that can move backward in x, such as a phase-plane trajectory. It is risky after arbitrary sorting. step is appropriate for piecewise-constant quantities such as dose level or an event status, not merely because it looks clean. area works best for a single series or already summarized series; overlapping subject areas obscure each other and should not be interpreted as AUC.

Ordering checks
Sort or inspect x within group before drawing. Duplicate x values can create vertical segments or arbitrary connections. Missing x or y breaks evidence because required rows are omitted. If records represent multiple occasions, include occasion in group or facet so the end of one occasion is not joined to the start of another.
Common mistakes
- Omitting group and connecting subjects together.
- Calling filled area a calculated AUC.
- Using path when row order is accidental.
- Joining separate occasions into one trajectory.
Checklist
- Define group at the subject/occasion level.
- Verify source or x ordering.
- Inspect duplicate and missing times.
- Use step only for stepwise quantities.
- Use
ncafor exposure integration.
Further reading
See data ordering, group mappings, area limitations, and Chapter 13's profile plots.