Hi everyone,
Could someone help me to get both \n (return) and italic() in a legend.
Here is a little example showing what I would like (but without the
italic) and second what I get:
plot(1, 1)
v1 <- "p-value\nbased on t-test"
legend("topright", legend=v1, y.intersp = 3, bty="n")
plot(1, 1)
v1 <- expression(italic("p")*"-value\nbased on "*italic("t")*"-test")
legend("topright", legend=v1, y.intersp = 3, bty="n")
The second one shows :
-value
pbased on t-test
rather than the expected:
p-value
based on t-test
Thanks a lot,
Marc
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.