Announcement

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

  • Placing a dot and a line segment on a graph

    Hi, I'd love to get some help on drawling a dot (or a filled in circle) at (126, 0) and a line segment starting at (126,0) and ending at (232.8,0) in the graph below.
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	499.7 KB
ID:	1688160



    Here's the code I'm using to generate the graph.

    Code:
    #delimit ;
    graph twoway (function y=normalden(x,0,58.2), range(-232.8 232.8) lw(medthick)  ) ||
                 (function y=normalden(x,-29.1,58.2), range(-232.8 232.8) lcolor(gs12)) ||
                 (function y=normalden(x,-58.2,58.2), range(-232.8 232.8) lcolor(gs12)) ,
      //title("Sampling distribution of difference in sample means")
      xtitle("Difference in sample means")
      xlabel(-232.8(58.2) 232.8)
      ylabel("",nogrid)
      yscale(off)
      xscale(lw(medthick))
      xscale(titlegap(5))
      yscale(lw(medthick))
      legend(off)
      graphregion(fcolor(white));
    #delimit cr
    Thank you!
    Attached Files

  • #2
    Code:
    #delimit ;
    graph twoway (function y=normalden(x,0,58.2), range(-232.8 232.8) lw(medthick)  ) ||
                 (function y=normalden(x,-29.1,58.2), range(-232.8 232.8) lcolor(gs12)) ||
                 (function y=normalden(x,-58.2,58.2), range(-232.8 232.8) lcolor(gs12)) ||
                 (pci 0 126 0 232.8) ||
                 (scatteri 0 126, msymbol(O)),
      //title("Sampling distribution of difference in sample means")
      xtitle("Difference in sample means")
      xlabel(-232.8(58.2) 232.8)
      ylabel("",nogrid)
      yscale(off)
      xscale(lw(medthick))
      xscale(titlegap(5))
      yscale(lw(medthick))
      legend(off)
      graphregion(fcolor(white))
      scheme(s2color)
      ;
    #delimit cr
    which produces:
    Click image for larger version

Name:	Screenshot 2022-11-05 at 10.40.23 AM.png
Views:	1
Size:	708.1 KB
ID:	1688172

    Last edited by Hemanshu Kumar; 04 Nov 2022, 23:11.

    Comment


    • #3
      This is perfect! Thank you, Hemanshu.

      Comment

      Working...
      X