Announcement

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

  • How to change x axis values after xtline?

    Hello,

    Is there a way to change monthly values that appear on the x axis (500 550 ...) The data has been xtset using monthly data but I want it to appear as 2000, 2001 etc. 500 550 does not mean anything for the reader.

    Thanks,
    Nazlı
    Attached Files

  • #2
    I can't see your data or your graph command or even read your graph, as it was produced using a later Stata than I am using at this moment. Please see FAQ Advice #12 on posting exact commands used and graph attachments as .png

    But a problem like that suggests that you have not supplied a suitable display format. Nevertheless you can specify what you want on the fly.

    Here is some sample code that you should be able to run. Very likely all you need specify are one or two graph options.

    Code:
    webuse air2, clear
    su t if time == 1960
    gen mdate = t - r(min)
    format mdate %tm
    tsset mdate
    tsline air, tla(1948m1(24)1960m1) xla(, format(%tmCCYY)) xtitle("")

    Comment

    Working...
    X