[R] phantom(0) doesn't do what I expect it to [plotmath]

Malcolm Gillies
Mon, 18 Sep 2000 11:32:56 -0000

Hi,

I'm trying to make a legend with a justified list of numbers, so I
thought I would use phantom(0) to align the 3-digit numbers properly
with the 4-digit ones:

    legend(x, y, xjust=1, yjust=1, lty=c(1,2,3,4,5), adj=c(0,0.5),
           legend=expression(phantom(0)*300*plain(K),
                             phantom(0)*550*plain(K),
                             phantom(0)*830*plain(K),
                                       1440*plain(K),
                                       2500*plain(K)))

Unfortunately, phantom(0) doesn't seem to be adding any space, whether
I use the X11 or the postscript device.

Am I being obtuse? Should I file a PR?

Suggestions for alternative solutions also appreciated (short of
measuring all the string widths and building it up by hand ;-)

cheers,

Malcolm
--
Malcolm Gillies <M.B.Gillies at pharm.uu.nl>
PhD student, computational medicinal chemistry
Dept of Medicinal Chemistry, Faculty of Pharmacy,
Utrecht University, The Netherlands
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._