diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/plot.mkinfit.R | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R index b42ce097..baa88069 100644 --- a/R/plot.mkinfit.R +++ b/R/plot.mkinfit.R @@ -186,11 +186,15 @@ plot.mkinfit <- function(x, fit = x, # Show residuals if requested if (show_residuals) { residuals <- subset(fit$data, variable %in% row_obs_vars, residual) - if (maxabs == "auto") maxabs = max(abs(residuals), na.rm = TRUE) + if (maxabs == "auto") { + maxabs_row = max(abs(residuals), na.rm = TRUE) + } else { + maxabs_row = maxabs + } if (!sep_obs) par(mar = c(5, 4, 0, 2) + 0.1) plot(0, type="n", xlim = xlim, - ylim = c(-1.2 * maxabs, 1.2 * maxabs), + ylim = c(-1.2 * maxabs_row, 1.2 * maxabs_row), xlab = xlab, ylab = "Residuals") for(obs_var in row_obs_vars){ residuals_plot <- subset(fit$data, variable == obs_var, c("time", "residual")) |