aboutsummaryrefslogtreecommitdiff
path: root/R/mkinparplot.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2021-02-24 14:46:10 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2021-02-24 14:58:04 +0100
commit64fa10032f99490a5998589161574109484ee769 (patch)
tree74c47a1c8d36a1b164029f808b6075f61d2ab43a /R/mkinparplot.R
parent7f35f5d98968f059176f4c339e1db8f17d5c4bf1 (diff)
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.
Diffstat (limited to 'R/mkinparplot.R')
-rw-r--r--R/mkinparplot.R4
1 files changed, 2 insertions, 2 deletions
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)
}

Contact - Imprint