Announcement

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

  • Shade under a line

    Hello,

    I am try making a time series chart and my goal is to shade all what is below the line. I would think I would have to use scatteri for what I want, but I don't know how to tell stata that. I attach an image (very ugly) to give you an idea.

    Greetings and thanks guys
    Attached Files

  • #2
    Code:
    webuse grunfeld, clear
    keep if company==1
    set scheme s1mono
    tw line invest year, sort xtitle("") saving(gr1, replace)
    tw area invest year, sort xtitle("") saving(gr2, replace)
    gr combine gr1.gph gr2.gph
    Res.:

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	25.5 KB
ID:	1672833

    Comment


    • #3
      Thank you very much for your answer, it was very useful, however when I plot, when I want to edit the line, all the contour is marked, and my goal is only to keep the top one. Can I delete the other lines?

      I attach the graph I made and what I want to delete.

      Thank you!!!

      Attached Files

      Comment


      • #4
        ref https://www.statalist.org/forums/for...23#post1672623
        Code:
        webuse grunfeld, clear
        keep if company==1
        
        tw line invest year, sort xtitle("") ///
        || area invest year, sort xtitle("") color(gs15) fint(100) leg(off) scheme(s1mono)

        Comment


        • #5
          Ohhh woowww!!!! Thank you so much, I was up all night trying to do this and had no idea how to go about it.

          Thank you Bjarte Aagnes and Andrew Musau. I will see if this last thing you share with me I can add it with what I already had previously.

          Comment


          • #6
            See also

            Code:
            Blog    . . . . . . . . . . . . Adding recession shading to time-series graphs
                    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D. Schenck
                    2/20    http://blog.stata.com/2020/02/13/adding-recession-shading-
                            to-time-series-graphs/
            
            SJ-16-3 gr0067  . Speaking Stata: Shading zones on time series and other plots
                    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
                    Q3/16   SJ 16(3):805--812                                (no commands)
                    discusses background shading of time series and other plots

            Comment


            • #7
              Originally posted by Nick Cox View Post
              See also

              Code:
              Blog . . . . . . . . . . . . Adding recession shading to time-series graphs
              . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D. Schenck
              2/20 http://blog.stata.com/2020/02/13/adding-recession-shading-
              to-time-series-graphs/
              
              SJ-16-3 gr0067 . Speaking Stata: Shading zones on time series and other plots
              . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
              Q3/16 SJ 16(3):805--812 (no commands)
              discusses background shading of time series and other plots
              Hi Nick,

              As always, a pleasure to read your suggestions I will take them into account for future works. Really, thank you very much for your support

              Comment

              Working...
              X