aboutsummaryrefslogtreecommitdiff
path: root/R/plot.mkinfit.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-10-16 16:31:29 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2015-10-16 16:31:29 +0200
commit08cae49345c048fdbb69befc5a3b3f7966836223 (patch)
treee420c606903015f105d804af89b8165df5aad841 /R/plot.mkinfit.R
parent4cc35d77e9ce6fb46f5ba37350a281bf0a82f286 (diff)
Full compound names in models that are shown in the plot
Diffstat (limited to 'R/plot.mkinfit.R')
-rw-r--r--R/plot.mkinfit.R8
1 files changed, 6 insertions, 2 deletions
diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R
index 31746fb8..f8ee600e 100644
--- a/R/plot.mkinfit.R
+++ b/R/plot.mkinfit.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2014 Johannes Ranke
+# Copyright (C) 2010-2015 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package mkin
@@ -76,7 +76,11 @@ plot.mkinfit <- function(x, fit = x,
}
matlines(out$time, out[obs_vars], col = col_obs[obs_vars], lty = lty_obs[obs_vars])
if (legend == TRUE) {
- legend(lpos, inset= inset, legend = obs_vars,
+ legend_names = lapply(names(fit$mkinmod$spec), function(x) {
+ if (is.na(fit$mkinmod$spec[[x]]$full_name)) x
+ else fit$mkinmod$spec[[x]]$full_name
+ })
+ legend(lpos, inset= inset, legend = legend_names,
col = col_obs[obs_vars], pch = pch_obs[obs_vars], lty = lty_obs[obs_vars])
}
# Show residuals if requested

Contact - Imprint