aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2021-01-25 17:55:06 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2021-01-25 17:55:06 +0100
commit0280b9c8dcc77cb1d22964485462b27a56b96eca (patch)
tree56f86e3530a374b019a5d34f08a8fec48350305c
parent737fc7f352bbb853b01ff6e3c6ec21a528da901e (diff)
Some more plotting improvements
-rw-r--r--NEWS.md4
-rw-r--r--R/plot.mixed.mmkin.R10
-rw-r--r--R/plot.mkinfit.R2
3 files changed, 8 insertions, 8 deletions
diff --git a/NEWS.md b/NEWS.md
index 3b02082b..4e97ac01 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -16,9 +16,9 @@
- '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.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. Reduce legend size and vertical distance between panels
-- 'plot.mkinfit': Change default ylab from "Observed" to "Residue"
+- 'plot.mkinfit': Change default ylab from "Observed" to "Residue". Pass xlab to residual plot if show_residuals is TRUE.
## Mixed-effects models
diff --git a/R/plot.mixed.mmkin.R b/R/plot.mixed.mmkin.R
index 109df283..1674d855 100644
--- a/R/plot.mixed.mmkin.R
+++ b/R/plot.mixed.mmkin.R
@@ -61,7 +61,7 @@ plot.mixed.mmkin <- function(x,
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.legend = 0.02 + 0.07 * nrow.legend,
rel.height.bottom = 1.1,
pch_ds = 1:length(i),
col_ds = pch_ds + 1,
@@ -182,7 +182,7 @@ plot.mixed.mmkin <- function(x,
n_plot_rows + 1, 2, byrow = TRUE)
layout(layout_matrix, heights = rel.heights)
- par(mar = c(0.1, 2.1, 0.6, 2.1))
+ par(mar = c(0.1, 2.1, 0.1, 2.1))
# Empty plot with legend
if (!is.null(pred_over)) lty_over <- seq(2, length.out = length(pred_over))
@@ -217,15 +217,15 @@ plot.mixed.mmkin <- function(x,
# Margins for bottom row of plots when we have more than one row
# This is the only row that needs to show the x axis legend
if (plot_row == n_plot_rows) {
- par(mar = c(5.1, 4.1, 2.1, 2.1))
+ par(mar = c(5.1, 4.1, 1.1, 2.1))
} else {
- par(mar = c(3.0, 4.1, 2.1, 2.1))
+ par(mar = c(3.0, 4.1, 1.1, 2.1))
}
plot(pred_pop$time, pred_pop[[obs_var]],
type = "l", lwd = 2, lty = lty_pop,
xlim = xlim, ylim = ylim_row,
- xlab = xlab, ylab = obs_var, frame = frame)
+ xlab = xlab, ylab = paste("Residues", obs_var), frame = frame)
if (!is.null(pred_over)) {
for (i_over in seq_along(pred_over)) {
diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R
index 9dbc91d7..eced40a4 100644
--- a/R/plot.mkinfit.R
+++ b/R/plot.mkinfit.R
@@ -277,7 +277,7 @@ plot.mkinfit <- function(x, fit = x,
if (show_residuals) {
mkinresplot(fit, obs_vars = row_obs_vars, standardized = standardized,
pch_obs = pch_obs[row_obs_vars], col_obs = col_obs[row_obs_vars],
- legend = FALSE, frame = frame)
+ legend = FALSE, frame = frame, xlab = xlab)
}
# Show error model plot if requested

Contact - Imprint