diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/TOXSWA_cwa.R | 8 |
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, ...) |