From b81cd4b32c8411637f31164cc696a471b1074baa Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 26 Oct 2020 14:23:04 +0100 Subject: Put the legend in its own area for plot.nlme.mmkin --- docs/dev/reference/plot.nlme.mmkin.html | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'docs/dev/reference/plot.nlme.mmkin.html') diff --git a/docs/dev/reference/plot.nlme.mmkin.html b/docs/dev/reference/plot.nlme.mmkin.html index c633e15a..afd9d8d0 100644 --- a/docs/dev/reference/plot.nlme.mmkin.html +++ b/docs/dev/reference/plot.nlme.mmkin.html @@ -151,17 +151,16 @@ plot( x, i = 1:ncol(x$mmkin_orig), - main = NULL, obs_vars = names(x$mkinmod$map), standardized = TRUE, xlab = "Time", xlim = range(x$data$time), - legends = 1, - lpos = "topright", - inset = c(0.05, 0.05), resplot = c("predicted", "time"), ymax = "auto", maxabs = "auto", + ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)), + nrow.legend = ceiling((length(i) + 1)/ncol.legend), + rel.height.legend = 0.03 + 0.08 * nrow.legend, rel.height.bottom = 1.1, pch_ds = 1:length(i), col_ds = pch_ds + 1, @@ -182,10 +181,6 @@

A numeric index to select datasets for which to plot the nlme fit, in case plots get too large

- - main -

The main title placed on the outer margin of the plot.

- obs_vars

A character vector of names of the observed variables for @@ -205,20 +200,6 @@ variables in the model.

xlim

Plot range in x direction.

- - legends -

An index for the fits for which legends should be shown.

- - - lpos -

Position(s) of the legend(s). Passed to legend as -the first argument. If not length one, this should be of the same length -as the obs_var argument.

- - - inset -

Passed to legend if applicable.

- resplot

Should the residuals plotted against time or against @@ -233,6 +214,10 @@ predicted values?

Maximum absolute value of the residuals. This is used for the scaling of the y axis and defaults to "auto".

+ + rel.height.legend +

The relative height of the legend shown on top

+ rel.height.bottom

The relative height of the bottom plot row

@@ -276,7 +261,8 @@ corresponding model prediction lines for the different datasets.

A1 = mkinsub("SFO"), quiet = TRUE) f <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE, cores = 1) plot(f[, 3:4], standardized = TRUE) -
library(nlme) +
+library(nlme) # For this fit we need to increase pnlsMaxiter, and we increase the # tolerance in order to speed up the fit for this example evaluation f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3)) -- cgit v1.2.1