Closed csdaw closed 3 years ago
This PR addresses the label text formatting feature request raised in #10.
Now the text in the label column can be parsed as a plotmath expression, as in geom_text().
label
geom_text()
See an example below:
library(magrittr) library(ggplot2) library(ggprism) # also use rstatix p <- ggplot(ToothGrowth, aes(x = factor(dose), y = len)) + geom_boxplot(aes(fill = dose), colour = "black") + theme_prism() + theme(legend.position = "none") stat.test <- rstatix::t_test(ToothGrowth, len ~ dose, ref.group = "0.5") %>% rstatix::add_xy_position() stat.test$p.exprs <- paste0("P==1*x*10^", round(log10(stat.test$p.adj), 0)) p + add_pvalue(stat.test, label = "p.exprs", parse = TRUE)
Created on 2021-06-17 by the reprex package (v1.0.0)
This PR addresses the label text formatting feature request raised in #10.
Now the text in the
label
column can be parsed as a plotmath expression, as ingeom_text()
.See an example below:
Created on 2021-06-17 by the reprex package (v1.0.0)