On Sun, 4 Feb 2024 at 17:26, Jibrin Alhassan <jibrin.alhas...@unn.edu.ng> wrote: > > Here is the script I used to plot the graph indicating the text I wanted to > insert. The line in the script that I have issues with is: text(-8,-8, > "R^2= 0.62", r = 0.79, N = 161", cex = 2 > R^2= 0.62 is not producing R squared = 0.62. > Thanks.
This works for me: curve(dnorm, from=-3, to=3, main="Normal Distribution") text(x=0, y=0.1, cex=1.5, expression(R^2 == 0.62)) if you are used to write expression using LaTeX math , then maybe you like the latex2exp package: curve(dnorm, from=-3, to=3, main="Normal Distribution") text(0, 0.1, latex2exp::TeX("$R^2 = 0.62$")) Regards Martin ______________________________________________ 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.