Announcement

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

  • How to add title to xline

    Can you help me how I can specify the vertical line while I am using "twoway connected" command to show the relation between yvar and xvar using line graph? For instance, how can I add description for the xline as "start" similar to the graph attached? you can use any time series data as example.
    Click image for larger version

Name:	Example xline identification as %22start%22.png
Views:	1
Size:	10.1 KB
ID:	1612223

  • #2
    Code:
    webuse grunfeld,clear
    twoway connected kstock year if company == 1, /// 
    xline(1940) xlabel( 1940 "Start" , axis(2)) xaxis(1 2) /// 
    xtitle("" , axis(2))

    Comment


    • #3
      Code:
      clear
      set obs 45
      gen time = _n+1935
      gen y = _n*runiform()
      twoway connected y time, xaxis(1 2) xline(1940) xlabel(1940 "start", axis(2)) xtitle("",axis(2))
      Click image for larger version

Name:	Graph.png
Views:	1
Size:	75.5 KB
ID:	1612230

      Comment


      • #4
        Dear Scott Merryman and Ali Atia, thank you so much this works for me!

        Comment

        Working...
        X