aboutsummaryrefslogtreecommitdiff
path: root/R/plot.mkinfit.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/plot.mkinfit.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/plot.mkinfit.R')
-rw-r--r--R/plot.mkinfit.R2
1 files changed, 1 insertions, 1 deletions
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

Contact - Imprint