Announcement

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

  • How add line on graph

    How i can add line to separate predict.(last) month

  • #2
    I think you just add -xline(td(1jan2016))- as an option on your -graph twoway line- command.

    Comment


    • #3
      if this code is working automaticaly , how work with line on last month ?

      Comment


      • #4
        Do you want to automatically place a line that marks the beginning of the month prior to the current month (today is 29 March, so put a line at 1 Feb, 2016)?

        Or, do you want to automatically place line that marks the beginning of the last month in your dataset (let's say your dataset runs from 1 Jan, 2000 to 31 Dec, 2002, then add a line at 1 Dec, 2002)?

        Or do you want something else?
        Stata/MP 14.1 (64-bit x86-64)
        Revision 19 May 2016
        Win 8.1

        Comment


        • #5
          Today is march, graphic predict next value on april, and i want to separate march and april, than april and may, etc.

          graph twoway line expprice price date,tline(01mar2016)
          Attached Files
          Last edited by Eva Smith; 30 Mar 2016, 04:48.

          Comment


          • #6
            Dear Eva, I'm sorry that I cannot understand what you would like here. I'm afraid that there is a bit of a language barrier. Perhaps you can find a friend or colleague to better explain your problem in English.
            Stata/MP 14.1 (64-bit x86-64)
            Revision 19 May 2016
            Win 8.1

            Comment


            • #7
              Hello
              I've troubles with adding vertical lines in my twoway time series graph too.
              On my y-axis there is the average TV-audience of 184 Champions League games and on the x-axis there is my time variable in terms of a clock time for example 21:30. The format of my time variable is %tcHH:MM and it's a double.

              When i type in my code as follows (because there are multiple overlaid line graphs)

              twoway (tsline avgrating_90 if group==1 & tin(20:45:00,22:33:00)) || (tsline avgrating_90 if group==2 & tin(20:45:00, 22:30:00)) || (tsline avgrating_90 if group==3 & tin(20:45:00, 22:30:00)) || (tsline avgrating_90 if group==4 & tin(20:45:00, 22:30:00)), tline( 21:30 21:45)

              it results an error called: "invalid line argument, 21:30 21:45"

              Click image for larger version

Name:	graph1.png
Views:	3
Size:	15.2 KB
ID:	1363853


              Help would be greatly appreciated
              Kind regards
              Elias

              ps: There is suddenly a vertical line but in my stata graph there isn't one (probably because I transformed my stata graph into a PNG-file for attaching it here).
              Attached Files

              Comment

              Working...
              X