Documentation

13A.19 Facet grid, wrap, panels, and free scales

Facets split a plot into panels while preserving a common definition. --facet-rows SEX --facet-cols ARM creates a grid; --facet STUDY --facet-ncol 2 wraps one or more variables into a compact layout. Several variables in a row, column, or wrap list are combined.

Facet choices and scale consequences

--facet-labels value shows the value alone; both shows COLUMN: value. --facet-scales fixed is default and supports direct magnitude comparison. free_x, free_y, or free allow panel-specific ranges, revealing within-panel shape but weakening between-panel magnitude comparisons. State free scales prominently.

The gallery residual plot uses SEX rows and ARM columns with horizontal lines at -2, 0, and 2. Its six panels make subgroup patterns visible, but cells are not independent trials and small apparent differences can be noise.

Missing facet values are not drawn and are noted. More than 200 panels are refused; an x variable with more than 60 categories is also refused. These guardrails prevent accidental unreadable figures rather than selecting a scientifically valid panel structure.

For novice review, make an unfaceted version first. It establishes overall scale and data coverage. Then add facets and compare panel row counts. If a pattern appears only after free scaling, ask whether it reflects genuine shape or simply magnification. A companion table of subjects and observations per panel prevents empty or sparse panels from being overread.

Common mistakes

  • Using free scales and comparing absolute heights across panels.
  • Creating one panel per subject when a grouped line would suffice.
  • Ignoring subjects with missing facet values.
  • Treating visual subgroup differences as tests.

Checklist

  • Choose grid for structured row/column comparisons and wrap for galleries.
  • Prefer fixed scales for magnitude comparison.
  • Count records and subjects per panel.
  • Review missing facet values.
  • Reduce excessive panels with meaningful grouping.

Further reading

See aesthetic grouping, scales, export sizing, and the diagnostic pack.