Announcement

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

  • enforcing zero in graph scales.

    In a plot , Stata decides the decimal formats in the numbers along the axes, for example .25, .50, .75

    for stylistic reasons though I like a leading zero ... so 0.25, 0.50, 0.75

    once you have a plot you can do that manually thru the "axis properties" then "edit or add.."

    but it's tedious. is there a line of code that can enforce a leading zero in a positive or negative fraction value? Thanks all.
    Last edited by peter peter; 04 Mar 2023, 04:50.

  • #2
    You can always specify a display format for axis labels and you can always specify exact text that you want to see. See

    Code:
    help axis label options
    Sometimes I want both:

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . graph bar foreign, over(rep78)
    
    . graph bar foreign, over(rep78) yla(0 "0" 1 "1" 0.5 "0.5" 0.25 0.75, format("%3.2f"))

    Comment


    • #3
      perfect. thanks.

      Comment

      Working...
      X