Skip to content
Prev 138873 / 398506 Next

LaTeX in R

You might want to read
  Ligges, U. (2002): R Help Desk: Automation of Mathematical Annotation 
in Plots. R News 2 (3), 32-34.
with an example at the end that meets your requirements:

(please note that I removed those ugly ";"


mySigma[1] <- 2
mySigma[2] <- 3
plot(1:10, dnorm(1:10, sd = mySigma[1]), type = 'l')
lines(dnorm(1:10, sd = mySigma[2]), lty = 2)
legend1 <- substitute(sigma == myS, list(myS = mySigma[1]))
legend2 <- substitute(sigma == myS, list(myS = mySigma[2]))
legend(x = "topright", lty = c(1,2),
        legend = do.call(expression, list(legend1, legend2)))


Uwe Ligges
Mario Maiworm wrote: