Announcement

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

  • Get rid of the space after the leading quote?

    Hi all,

    Please see the graph below and the example codes. In the 'note' option in my codes, I have not kept any space but the graph is being produced with large space in the note "Overall mean±SD" (underlined red thick line). Is there any way of getting rid of the space that's being produced by the leading quote?

    Code:
    sysuse auto, clear
    
    qui su mpg
    loc  m : di %12.0f r(mean)
    loc sd : di %12.0f r(sd)
        #delimit ;
            twoway (scatter mpg weight) ||
            (lfit mpg weight),
            yline(`m', lpatt(--))
            note("Overall mean±SD:`m'(±`sd')")
        ;
        #delimit cr
    Click image for larger version

Name:	test.png
Views:	1
Size:	103.5 KB
ID:	1632852
    Last edited by Roman Mostazir; 22 Oct 2021, 05:38.
    Roman

  • #2
    Your purpose is rounding to integers and even

    Code:
     
     loc  m : di %1.0f r(mean)

    should work fine.

    Code:
    . di %1.0f 123456.789
    123457

    Comment


    • #3
      Of course it is!! How stupid I am. Thanks Nick. I was thinking it is the leading quote that is trailing the space but it is the number format.
      Roman

      Comment

      Working...
      X