[R] problem with `legend' + `substitute'

Timur Elzhov Timur.Elzhov at jinr.ru
Tue Nov 12 13:22:49 CET 2002


Hello, R experts!

I'd like to add the somewhat complicated expression as "legend"
to the plot:

  x  <-  1
  T  <- 10

  plot(x)
  legend   ( 1.0 ,1.0
            ,substitute ( paste ( Sr["2"] ,GaMnO["5.541"]
                                 ,", T = " ,T ,"K"
                                )
                         ,list (T = T)
                        )
            ,bg = "white"
            ,xjust = 0.5
            ,yjust = 0.5
           )

So, I get plot with not one, but *six* instances of the desired expression,
one under another!

Ok, trying to use `text' ..

  plot(x)
  text     ( 1.0 ,1.0
            ,substitute ( paste ( Sr["2"] ,GaMnO["5.541"]
                                 ,", T = " ,T ,"K"
                                )
                         ,list (T = T)
                        )
            ,adj = c(0.5, 0.5)
           )

Well, `text' works properly!  but why `legend' behaves so?


(I'm running R v1.6.1 on Debian woody system for i386)

Thanks,
Timur.




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list