Skip to content

Subscript and superscript on one symbol; plotmath.

6 messages · Dr Eberhard W Lisse, Eric Berger, Duncan Murdoch +1 more

#
I would like to produce, as graphical annotation, the Greek letter sigma
with a superscript of 2 and a subcript of 11.  (I.e. the top left hand
entry of a covariance matrix.)

I've tried:

plot(1:10,main=expression({sigma^2}[11]))

(and variants).  This "sort of" works but there is an undesirable
gap between the sigma and the subscript 11. (IOW the subscript is to
the right of the superscript, whereas ideally the first "1" in "11"
should be vertically below the superscript.

I've also tried (hammer and hope!):

plot(1:10,main=expression(sigma*atop(scriptstyle(2),scriptstyle(11))))

and again this "sort of" works but places the putative superscript a
bit too high and the putative subscript a bit too low.

Is there any way to achieve, with plotmath, an effect like unto that
produced by the LaTeX expression $\sigma^2_{11}$?  Or should I just
give up and go to the pub? :-)

cheers,

Rolf Turner

P.S.  I've explicitly CC-ed Paul Murrell, who is obviously the go-to
guy on such matters, in case he does not regularly monitor this list.

R. T.
#
They let you guys go to the pup again? :-)-O

el
On 09/12/2020 10:06, Rolf Turner wrote:
[...]
[...]
#
Hi Rolf,
This is not addressing your implementation, but reformulates the goal.
Specifically, the covariance matrix is normally written as \Sigma (not
\sigma^2).
So to specify the upper left element you would write (in Latex)
\Sigma_{11}.
No superscript (so no problem!)

HTH,
Eric
On Wed, Dec 9, 2020 at 10:17 AM Dr Eberhard W Lisse <el at lisse.na> wrote:

            

  
  
#
On 09/12/2020 3:06 a.m., Rolf Turner wrote:
When I run

  plot(1:10,main=expression(sigma[11]^2))

I think I get what you want.

Duncan Murdoch
#
On Wed, 9 Dec 2020 06:18:10 -0500
Duncan Murdoch <murdoch.duncan at gmail.com> wrote:

            
<SNIP>

Dang!!! I was sure that that's one of the variants I'd tried!!!
Duh.  This is indeed exactly what I want.  Thanks Duncan.

cheers,

Rolf
#
On 09/12/2020 6:45 p.m., Rolf Turner wrote:
You probably did try it, but remember what Einstein is supposed to have 
said:

?Insanity is doing the same thing over and over and expecting different 
results.?

It just shows that it helps to be a little insane.

Duncan Murdoch