Announcement

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

  • Now I want to know how to graph a circle in STATA.

    Now I want to know how to graph a circle in STATA. I tried to include a circle into a graph which portrait peaks of mountain in order to depict a sun or moon.

  • #2
    Welcome to the Stata Forum / Statalist,


    Here you will find an example. It is the Stata Tip 15: Function graphs on the fly, written by Nick Cox.

    Best regards,

    Marcos

    Comment


    • #3
      You can also use -scatter- or -scatteri- to plot a single point with a 'huge' msymbol that could serve your purpose. eg


      Code:
           clear
           set obs 10
           g id = _n
           g x =  rnormal(5, 1)
           g sun = 6 if id==7
           
           twoway (area x id, sort ) ///
              (scatter sun id, mcolor(gold%60) msize(vhuge) msym(circle)) ///
              (scatter sun id, mcolor(orange%20) msize(huge) msym(circle)) ///
              , legend(off)
      Click image for larger version

Name:	Graph.png
Views:	1
Size:	138.0 KB
ID:	1423723

      Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

      Comment


      • #4
        Thank you for your help.
        This is what I want to draw below.
        Last edited by SungJun Kim; 26 Dec 2017, 23:39.

        Comment


        • #5
          Originally posted by SungJun Kim View Post
          Thank you for your help.
          This is what I want to draw below.
          Another approach is using the ascii/unicode symbols for a sun (using Stata 15.1):

          Code:
            clear
               set obs 10
               g id = _n
               g x =  rnormal(5, 1)
               g sun = 6 if id==7
               
               twoway (area x id, sort ) ///
                  (scatter sun id, mcolor(gold%60) msize(vhuge) msym(circle)) ///
                  (scatter sun id, mcolor(orange%20) msize(huge) msym(circle)) ///
                  , legend(off)
                  
              g sun2 = "☀" if id==7
                  twoway (area x id, sort ) ///
                  (scatter sun id, mlabcolor(orange%90) msym(none) mlabsize(vhuge) mlab(sun2)) ///
                  , legend(off)
          Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

          Comment

          Working...
          X