[R] Displaying Equation With Numerator and Demomenator On A Plot...

Jason Rupert jasonkrupert at yahoo.com
Thu Jan 21 23:10:44 CET 2010


Is there a way to display something like the quadratic equation, i.e. with a numerator and demonator on a plot? 

I think there is a way to create the equation in Latex, but wasn't sure if this format would translate to plotting.

\begin{equation}
  x = \frac{b +/- sqrt(b^2 - 4*a*c)}{2*a}
\end{equation}

 
My searched turned up the following:
http://tolstoy.newcastle.edu.au/R/e6/help/09/03/9010.html
 
Unfortunately, it does not address equations with numerators and demomenators.  
 
Here is a guess (but this fails):
 
### Change spacing to allow for multiline title
par(oma=c(2, 0, 4, 0))
### Some greek letters
mu <- 0
alpha <- 1
beta <- 2
delta <- 3
lambda <- 4
### Some graph or other
plot(1:10,1:10)
mtext(expression(bold("Meaningless Title")),
      line=3.5,cex=1.15)
mtext(bquote(x == \frac{b +/- sqrt(b^2 - 4*a*c)}{2*a}, line=2.25,cex=1.15)
 
 
Thanks again for any and all help. 






More information about the R-help mailing list