aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-12-15 17:25:21 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2017-12-15 17:25:21 +0100
commit87d63e649da5e12409c50cb06d3d2a01e9880759 (patch)
treef9c40d865af0967976fe71c529c676e18a6e46dd /R
parent4944d7ade227f1dd54c94b6a02c3c849dc1fb8ab (diff)
Improve handling of ยต in y axis for plot.TOXSWA_cwa
Diffstat (limited to 'R')
-rw-r--r--R/TOXSWA_cwa.R8
1 files changed, 7 insertions, 1 deletions
diff --git a/R/TOXSWA_cwa.R b/R/TOXSWA_cwa.R
index 81df85f..eacd58f 100644
--- a/R/TOXSWA_cwa.R
+++ b/R/TOXSWA_cwa.R
@@ -129,7 +129,13 @@ plot.TOXSWA_cwa <- function(x, time_column = c("datetime", "t", "t_firstjan", "t
t_rel_to_max = "Time relative to maximum concentration [days]")
}
if (identical(ylab, "default")) {
- ylab = paste( ifelse(total, "Total concentration", "Concentration"), "[\u03bcg/L]")
+ # Use LateX if the current plotting device is tikz
+ if (names(dev.cur()) == "tikz output") {
+ ylab = paste( ifelse(total, "Total concentration", "Concentration"), "[$\\mu$g/L]")
+ } else {
+ conc_string <- ifelse(total, "Total concentration", "Concentration")
+ ylab = bquote(.(conc_string) ~ group("[", mu*g/L, "]"))
+ }
}
if (add) {
lines(plot_data, xlab = xlab, ylab = ylab, ...)

Contact - Imprint