Announcement

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

  • Remove space in graph title

    Dear Statalisters,

    Is there anyway to reduce the space in my graph title with r-square. Please note that I have no space in the codes when referring the local macro, yet the number in the title is quite spaced out. Any idea, how to get rid of it:


    Code:
    sysuse auto, clear
    
    qui reg mpg weight
    loc r2: di %12.3f e(r2)
    scatter mpg weight, ti("{bf:R-squared:`r2'}", col(red))

    Click image for larger version

Name:	test.png
Views:	1
Size:	154.2 KB
ID:	1455784
    Roman

  • #2
    Hi Roman,
    You need to change the formatting of the local for the r^2. You have %12.3f, so it is holding 8 blank spaces in front of the number.
    Last edited by Carole J. Wilson; 30 Jul 2018, 16:11. Reason: Fixed # of spaces.
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      Ah ! Carole many thanks, ...
      Roman

      Comment

      Working...
      X