Brian Beckage wrote:

Dear List,

I'd like to add text to a plot where a text symbol has both a superscript and subscript. For example, the variable S with a superscript 2 and a subscript t. I have been able to accomplish this using either

expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )

or

expression( {S[t]}^2 )

but the spacing isn't quite right (or rather what I'd like) using either of these. By 'right' I mean the placement and spacing don't quite coincide with what I'd expect if I superimposed S^2 with S[t]. Is there a way to place BOTH a subscript and superscript so that they are placed identically as if I had overlayed S^2 and S[t]?

I'm using R 1.9.0 on Mac OSX.

Thanks,
Brian


I think that depends on the font in use. If letters don't have the same width, it is difficult to calculate pretty bounding boxes ... and the expected behaviour is to left-align. Hence it's as expected.


Are you volunteering to add some fuzz to plotmath.c? I guess you will have to add quite a lot of code for this tiny step... (and R is not TeX, BTW).

Uwe Ligges

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to