Skip to content

Adding Latex to text

3 messages · David Arnold, Rolf Turner, David Winsemius

#
Hi,

I'd like to add "alpha" in latex code to my image. Any suggestions?

library(UsingR)
BagA = c(rep(10,6),rep(20,5), rep(30,4),rep(40,3),rep(50,2),60,70)
BagA
BagB = c(10, 20,rep(30,2),rep(40,3),rep(50,4),rep(60,5),rep(70,6))
BagB

par(mfrow = c(2, 1))
DOTplot(BagA)
abline(v=60,lwd=2,lty=2,col="red")
text(65,3, "alpha-->", col=2)
abline(v=50, lwd=2, lty=2, col="blue")
text(57,5, "p-value------->", col="blue")
DOTplot(BagB)
abline(v=60,lwd=2,lty=2,col="red")
text(55,3, "<--beta", col=2)
par(mfrow = c(1, 1))



--
View this message in context: http://r.789695.n4.nabble.com/Adding-Latex-to-text-tp4657746.html
Sent from the R help mailing list archive at Nabble.com.
#
Perhaps you want to look at

     ?plotmath

     cheers,

         Rolf Turner
On 02/07/2013 11:41 AM, David Arnold wrote:
#
On Feb 6, 2013, at 4:53 PM, Rolf Turner wrote:

            
Definitely ...  he _will_ want to look at ?plotmath, but there is a lot on that page and teh parts that explain the parsing of expressions were not at all clear to me in hte beginning. Some of us find it's better to learn from examples and since he has already constructed a perfectly fine one hten here's my effort at making it "work":

library(UsingR)
BagA = c(rep(10,6),rep(20,5), rep(30,4),rep(40,3),rep(50,2),60,70)
BagA
BagB = c(10, 20,rep(30,2),rep(40,3),rep(50,4),rep(60,5),rep(70,6))
BagB

par(mfrow = c(2, 1))
DOTplot(BagA)
abline(v=60,lwd=2,lty=2,col="red")
text(65,3, expression(alpha*"-->"), col=2)
abline(v=50, lwd=2, lty=2, col="blue")
text(57,5, "p-value------->", col="blue")
DOTplot(BagB)
abline(v=60,lwd=2,lty=2,col="red")
text(55,3, expression("<--"*beta), col=2)
par(mfrow = c(1, 1))
David Winsemius
Alameda, CA, USA