Captures a graphics-parameter state and returns a closure that restores it. This helper centralises the common `par()`/`on.exit()` pattern used by diagnostic plotting functions.
saveGraphicsParameters(..., noReadonly = FALSE)A function that restores the saved graphics parameters and invisibly returns them.
Graphics parameters passed to [graphics::par()] when `noReadonly = FALSE`.
Logical; if `TRUE`, save all readonly-safe graphics parameters using `par(no.readonly = TRUE)`.