From 64fa10032f99490a5998589161574109484ee769 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/mkinparplot.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'R/mkinparplot.R') diff --git a/R/mkinparplot.R b/R/mkinparplot.R index f9abab5b..8cae30fb 100644 --- a/R/mkinparplot.R +++ b/R/mkinparplot.R @@ -32,7 +32,8 @@ mkinparplot <- function(object) { fractions.optim = length(fractions.optim)) n.plot <- n.plot[n.plot > 0] - oldpars <- par(no.readonly = TRUE) + oldpar <- par(no.readonly = TRUE) + on.exit(par(oldpar, no.readonly = TRUE)) layout(matrix(1:length(n.plot), ncol = 1), heights = n.plot + 1) s <- summary(object) @@ -71,5 +72,4 @@ mkinparplot <- function(object) { as.numeric(values.upper.nonInf), parname_index, code = 3, angle = 90, length = 0.05)) } - par(oldpars) } -- cgit v1.2.1