Skip to content

plotting Formulas with greek letters and variable values (expression, substitute, paste, ...)

4 messages · Uwe Ligges, Gabor Grothendieck, rrookie1982

#
Hallo together,

I want to write a formula of the type

http://n4.nabble.com/file/n1016112/expression.gif 







into my plot, where the values 1.234 and -0.567 should origin from variables
in the program. The threads in this forum gave me some ideas that the
functions expression(), paste(), and substitute() will get me there but I
just cannot figure out how to do it. The closest I got is:

text(0,7.5,substitute(expression(paste(symbol("t"),"(A) = ",c1 +
lg(A^c2),sep="")),list(c1=0,456,c2=-0.123)),pos=4)

Thankful for any suggestions!
Daniel
#
On 17.01.2010 18:47, rrookie1982 wrote:
It is much easier, just write the formula down in R syntax and 
substitute the relevant variables as in:

text(0, 7.5, substitute(tau(A) == a*lg(A^b), list(a=1.234, b=-0.567)))

Best,
Uwe Ligges
#
Try bquote:

a <- 0.1; b <- 0.2
plot(0, main = bquote(tau(A) == .(a)*lg(A^.(b))))
On Sun, Jan 17, 2010 at 12:47 PM, rrookie1982 <desser1 at uni-bonn.de> wrote:
#
rrookie1982 wrote:

        
Uwe Ligges-3 wrote:

        
Gabor Grothendieck wrote:
Wow, those two examples are indeed much simpler than my tries and work just
fine. Now I just will have two choose which way to go:
both work exactly how I wanted them to do.
Thank you Uwe and Gabor