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 --- NEWS.md | 5 +++ R/plot.mkinfit.R | 2 +- R/plot.mmkin.R | 6 ++- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/Rplot001.png | Bin 1011 -> 19395 bytes docs/dev/reference/Rplot006.png | Bin 56330 -> 24624 bytes docs/dev/reference/Rplot007.png | Bin 25161 -> 25074 bytes docs/dev/reference/plot.mkinfit-1.png | Bin 53731 -> 53151 bytes docs/dev/reference/plot.mkinfit-2.png | Bin 73830 -> 73247 bytes docs/dev/reference/plot.mkinfit-3.png | Bin 69215 -> 67810 bytes docs/dev/reference/plot.mkinfit-4.png | Bin 73285 -> 72295 bytes docs/dev/reference/plot.mkinfit-5.png | Bin 68646 -> 66920 bytes docs/dev/reference/plot.mkinfit-6.png | Bin 74042 -> 73078 bytes docs/dev/reference/plot.mkinfit-7.png | Bin 75294 -> 73909 bytes docs/dev/reference/plot.mkinfit.html | 4 +- docs/dev/reference/plot.mmkin-1.png | Bin 50628 -> 49402 bytes docs/dev/reference/plot.mmkin-2.png | Bin 50911 -> 49753 bytes docs/dev/reference/plot.mmkin-3.png | Bin 47267 -> 46090 bytes docs/dev/reference/plot.mmkin-4.png | Bin 34181 -> 33266 bytes docs/dev/reference/plot.mmkin-5.png | Bin 58620 -> 57777 bytes docs/dev/reference/plot.mmkin.html | 7 ++- docs/dev/reference/saem.html | 49 ++++++++------------- man/plot.mkinfit.Rd | 2 +- man/plot.mmkin.Rd | 3 ++ .../nafta-sop-appendix-b.svg | 6 +-- .../plot-nafta-analysis.svg | 6 +-- .../mkinfit-plot-for-focus-c-with-defaults.svg | 2 +- ...ot-for-focus-c-with-residuals-like-in-gmkin.svg | 2 +- .../mkinfit-plot-for-focus-c-with-sep-true.svg | 2 +- tests/figs/plotting/mmkin-plot-for-focus-c.svg | 8 ++-- .../plotting/mmkin-plot-for-sfo-focus-c-and-d.svg | 4 +- tests/figs/plotting/plot-err-for-focus-d.svg | 2 +- .../figs/plotting/plot-errmod-with-focus-c-tc.svg | 2 +- .../plot-errmod-with-focus-d-obs-eigen.svg | 2 +- tests/figs/plotting/plot-res-for-focus-c.svg | 2 +- tests/figs/plotting/plot-res-for-focus-d.svg | 2 +- 36 files changed, 62 insertions(+), 58 deletions(-) diff --git a/NEWS.md b/NEWS.md index a3fe63ed..3b02082b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,10 @@ - 'transform_odeparms', 'backtransform_odeparms': Use logit transformation for solitary fractions like the g parameter of the DFOP model, or formation fractions for a pathway to only one target variable +- 'plot.mmkin': Add a ylab argument, making it possible to customize the y axis label of the panels on the left without affecting the residual plots + +- 'plot.mkinfit': Change default ylab from "Observed" to "Residue" + ## Mixed-effects models - 'mixed.mmkin' New container for mmkin objects for plotting with the 'plot.mixed.mmkin' method @@ -32,6 +36,7 @@ - 'saem' generic function to fit saemix models using 'saemix_model' and 'saemix_data', with a generator 'saem.mmkin', summary and plot methods + # mkin 0.9.50.3 (2020-10-08) - 'parms': Add a method for mmkin objects 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) diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index 3591cac8..2963e810 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -10,7 +10,7 @@ articles: web_only/NAFTA_examples: NAFTA_examples.html web_only/benchmarks: benchmarks.html web_only/compiled_models: compiled_models.html -last_built: 2021-01-11T11:41Z +last_built: 2021-01-25T13:41Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png index 17a35806..bca41e2c 100644 Binary files a/docs/dev/reference/Rplot001.png and b/docs/dev/reference/Rplot001.png differ diff --git a/docs/dev/reference/Rplot006.png b/docs/dev/reference/Rplot006.png index 921e0394..da52f580 100644 Binary files a/docs/dev/reference/Rplot006.png and b/docs/dev/reference/Rplot006.png differ diff --git a/docs/dev/reference/Rplot007.png b/docs/dev/reference/Rplot007.png index fcca232c..fce3b6ee 100644 Binary files a/docs/dev/reference/Rplot007.png and b/docs/dev/reference/Rplot007.png differ diff --git a/docs/dev/reference/plot.mkinfit-1.png b/docs/dev/reference/plot.mkinfit-1.png index fc195031..e5da9f1c 100644 Binary files a/docs/dev/reference/plot.mkinfit-1.png and b/docs/dev/reference/plot.mkinfit-1.png differ diff --git a/docs/dev/reference/plot.mkinfit-2.png b/docs/dev/reference/plot.mkinfit-2.png index fa99f680..376c812f 100644 Binary files a/docs/dev/reference/plot.mkinfit-2.png and b/docs/dev/reference/plot.mkinfit-2.png differ diff --git a/docs/dev/reference/plot.mkinfit-3.png b/docs/dev/reference/plot.mkinfit-3.png index 28789544..c976d4b1 100644 Binary files a/docs/dev/reference/plot.mkinfit-3.png and b/docs/dev/reference/plot.mkinfit-3.png differ diff --git a/docs/dev/reference/plot.mkinfit-4.png b/docs/dev/reference/plot.mkinfit-4.png index 77b3422f..c8bc00fe 100644 Binary files a/docs/dev/reference/plot.mkinfit-4.png and b/docs/dev/reference/plot.mkinfit-4.png differ diff --git a/docs/dev/reference/plot.mkinfit-5.png b/docs/dev/reference/plot.mkinfit-5.png index b4b6528b..bc44de88 100644 Binary files a/docs/dev/reference/plot.mkinfit-5.png and b/docs/dev/reference/plot.mkinfit-5.png differ diff --git a/docs/dev/reference/plot.mkinfit-6.png b/docs/dev/reference/plot.mkinfit-6.png index f71f1769..eb8cbd92 100644 Binary files a/docs/dev/reference/plot.mkinfit-6.png and b/docs/dev/reference/plot.mkinfit-6.png differ diff --git a/docs/dev/reference/plot.mkinfit-7.png b/docs/dev/reference/plot.mkinfit-7.png index 98fee908..92a664f4 100644 Binary files a/docs/dev/reference/plot.mkinfit-7.png and b/docs/dev/reference/plot.mkinfit-7.png differ diff --git a/docs/dev/reference/plot.mkinfit.html b/docs/dev/reference/plot.mkinfit.html index c7eda78f..c5bfb528 100644 --- a/docs/dev/reference/plot.mkinfit.html +++ b/docs/dev/reference/plot.mkinfit.html @@ -123,7 +123,7 @@ observed data together with the solution of the fitted model." />