简体   繁体   中英

text() to display a greek letter with subscript in R plot

I was wondering how I could make the letter " sigma " appear in Greek with the subscript " m " in the text() part of the R code below?:

curve(dnorm(x,175.3,.961),160,190,type="l")

sigmam <- dnorm(177.4,175.3,.961)/ dnorm(177.4,176,4)

text(165,.285,paste("sigmam", "=", round(1/sigmam,digits=2)))

Check out ?plotmath for relevant examples of how to piece this sort of thing together. For instance, here's one adapted from the " ## How to combine "math" and numeric variables : "

curve(dnorm(x,175.3,.961),160,190,type="l")
sigmam <- dnorm(177.4,175.3,.961)/ dnorm(177.4,176,4)

text(165,.285, bquote(Sigma[m] == .(round(sigmam,2))))

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM