From 737fc7f352bbb853b01ff6e3c6ec21a528da901e Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 25 Jan 2021 14:45:04 +0100 Subject: Change default ylab in plot.mkinfit, explicit ylab for plot.mmkin See NEWS.md. Closes #12 --- R/plot.mkinfit.R | 2 +- R/plot.mmkin.R | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'R') diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R index 6ac4e45d..9dbc91d7 100644 --- a/R/plot.mkinfit.R +++ b/R/plot.mkinfit.R @@ -91,7 +91,7 @@ utils::globalVariables(c("type", "variable", "observed")) #' @export plot.mkinfit <- function(x, fit = x, obs_vars = names(fit$mkinmod$map), - xlab = "Time", ylab = "Observed", + xlab = "Time", ylab = "Residue", xlim = range(fit$data$time), ylim = "default", col_obs = 1:length(obs_vars), diff --git a/R/plot.mmkin.R b/R/plot.mmkin.R index 0523e4d3..f8ed1f9a 100644 --- a/R/plot.mmkin.R +++ b/R/plot.mmkin.R @@ -15,6 +15,7 @@ #' @param resplot Should the residuals plotted against time, using #' \code{\link{mkinresplot}}, or as squared residuals against predicted #' values, with the error model, using \code{\link{mkinerrplot}}. +#' @param ylab Label for the y axis. #' @param standardized Should the residuals be standardized? This option #' is passed to \code{\link{mkinresplot}}, it only takes effect if #' `resplot = "time"`. @@ -55,6 +56,7 @@ #' @export plot.mmkin <- function(x, main = "auto", legends = 1, resplot = c("time", "errmod"), + ylab = "Residue", standardized = FALSE, show_errmin = TRUE, errmin_var = "All data", errmin_digits = 3, @@ -117,9 +119,9 @@ plot.mmkin <- function(x, main = "auto", legends = 1, fit <- x[[i.fit]] if (ymax == "auto") { - plot(fit, legend = legends == i.fit, ...) + plot(fit, legend = legends == i.fit, ylab = ylab, ...) } else { - plot(fit, legend = legends == i.fit, ylim = c(0, ymax), ...) + plot(fit, legend = legends == i.fit, ylim = c(0, ymax), ylab = ylab, ...) } title(main, outer = TRUE, line = -2) -- cgit v1.2.1