Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aligning subscripts and superscripts in graphs' text elements

    Does anyone know if it's possible to horizontally align subscripts and superscripts using text elements in Stata graphs?
    Code:
    help graph_text
    Specifying
    Code:
    ...ti("y{sub:j,k}{sup:2}")...
    results in (understandably) the "2" superscript appearing to the northeast of the "j,k" subscript. My goal would be to have "2" appear above the "j".

    Thanks in advance for any suggestions.

  • #2
    John, as far as I know, I don't think you can have a double subscript or anything like that. However, because line-breaks are allowed in titles, you can use a combination of subscripts, superscripts and spacing to "trick" Stata to do what you want. You can also experiment with different fonts. For your example above:

    Code:
    sysuse auto
    scatter mpg weight, ti(  "y  {sub:2}""{sup:j,k}") scheme(s1color)
    scatter mpg weight, ti(  "y  {sub:{stMono:{bf:2}}}""{sup:j,k}") scheme(s1color)


    Result:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	56.3 KB
ID:	1501610

    Comment


    • #3
      Thanks Andrew.

      I'm not fluent in SMCL language and had been hoping that something like
      Code:
      {space #}
      might work with negative #s, but that evidently takes only nonnegative integer #s.

      Your trick looks promising; I'll give it a try.

      Comment

      Working...
      X