From 28c0dff7d7191f854be610b5384e965d9b191f98 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 24 Feb 2021 14:46:10 +0100 Subject: Reset graphical parameters with on.exit() plot.mixed.mmkin did not reset graphical parameters at all. The other plotting functions did not use on.exit, so this change should make the use of the plotting functions safer. --- R/plot.mkinfit.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'R/plot.mkinfit.R') diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R index eced40a4..2e319aae 100644 --- a/R/plot.mkinfit.R +++ b/R/plot.mkinfit.R @@ -161,6 +161,7 @@ plot.mkinfit <- function(x, fit = x, if (do_layout) { # Layout should be restored afterwards oldpar <- par(no.readonly = TRUE) + on.exit(par(oldpar, no.readonly = TRUE)) # If the observed variables are shown separately, or if requested, do row layout if (sep_obs | row_layout) { @@ -287,7 +288,6 @@ plot.mkinfit <- function(x, fit = x, legend = FALSE, frame = frame) } } - if (do_layout) par(oldpar, no.readonly = TRUE) } #' @rdname plot.mkinfit -- cgit v1.2.1