Announcement

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

  • How to include an oblique line on a graph ?

    Hello everybody,
    It is my first post here, sorry if I am not totally respecting customs (I don't know for example if my question is not too simple).
    My trouble is about drawing a line. My graph represents the income and declared income of a set of individuals. I want an oblique line representing the frontier of 100% income declaration.

    I have the following graph:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	10.5 KB
ID:	1345693



    I obtained it in the following way: tw (scatter amountdeclared income if serment==0, mcolor(blue)), ytitle(Revenu déclaré) xtitle(Revenu)

    I would like to draw an oblique line from the lowest corner on the left to the higher corner of the right, with all the points declaring 100% on it.

    Do you think there would be a way to do it with stata ?

    Thank you very much in advance.

    Best regards,
    Antoine


  • #2
    Try this:
    Code:
    tw (scatter amountdeclared income if serment==0, mcolor(blue)) (line income income), ytitle(Revenu déclaré) xtitle(Revenu)
    You may want to add some options to control line style and color, but that give you a line to work with.

    Comment


    • #3
      Clyde is right, naturally, but I've found that

      Code:
      (line income income, sort)
      does no harm.

      Comment


      • #4
        Originally posted by Clyde Schechter View Post
        Try this:
        Code:
        tw (scatter amountdeclared income if serment==0, mcolor(blue)) (line income income), ytitle(Revenu déclaré) xtitle(Revenu)
        You may want to add some options to control line style and color, but that give you a line to work with.
        Originally posted by Nick Cox View Post
        Clyde is right, naturally, but I've found that

        Code:
        (line income income, sort)
        does no harm.

        Thank you very much !

        Comment

        Working...
        X