Announcement

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

  • Special characters in Stata graph

    Dear all,

    I am struggling with special characters used in the ytitle option.
    ***
    twoway (line lncit lnrank) (connected lncit lnrank) , title("power law plot) legend(off) graphregion(color(white)) xsize(5) ysize(5) xtitle("lnrank{subscript:pist}") ytitle("lnc{subscript:pist}")
    ***
    In "ytitle", the lnc refers to the natural logarithm of "the mean of c". Hence, I want to include an "overline" (i.e. a bar on top of the letter).
    I have no idea how to code it.

    Thanks for your consideration.



  • #2
    Does maybe char help you? Check here: http://www.stata.com/statalist/archi.../msg00446.html

    Comment


    • #3
      char() won't help here, unfortunately, even in versions <14. Nor I think will Unicode help. What Florian needs, as it were, is support for TeX or LaTeX in graphs and many of us would like that too.

      Comment


      • #4
        thanks for this clarification.

        Comment


        • #5
          If you have Stata 14, it can be done. Go to http://unicode.org/charts. Locate "Combining diacritical marks" and find "combining overline". The hexadecimal code is 305, corresponding to decimal 773. Now do this:
          Code:
          sysuse auto
          local overline = uchar(773)
          scatter mpg weight , ytitle("lnc`overline'")
          You may benefit from the unofficial grtext command:
          Code:
          ssc install grtext
          But with Stata <14, there is probably nothing you can do.

          Comment


          • #6
            If you are using Stata 14 then this should work:

            ytitle(`=ustrunescape("\u0063\u0305\u006f\u0305")' {subscript:pist})

            The problem is that the characters in the title must be the same size as the 'combining overline' mark u0305 is positioned relative to the letter which is overlining. If you include I:

            ytitle(`=ustrunescape("\u006c\u0305\u0063\u0305\u0 06f\u0305")'{subscript:pist})

            then the overline is not aligned.

            Martyn

            Comment


            • #7
              hi Martyn, I installed STATA 14 and does work, thanks!

              Comment

              Working...
              X