Announcement

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

  • Add text to figure?

    Hi everyone:
    I'm trying to add a couple of text labels to my figure, which shows two normal distributions. I'd like to add the labels H_0 and H_a to these. Here's the code I wrote but the text doesn't show up. I'd appreciate any suggestions you might have.

    // Graph beta, the probability of making a type II error
    #delimit;
    twoway
    function y=normalden(x,0.031,0.0007), range(0.0283509 0.0316491) ///
    bcolor(gs12) recast(area) ||
    function y=normalden(x,0.030,0.0007), range(0.0272 0.0328) ///
    clstyle(foreground) ||
    function y=normalden(x,0.031,0.0007), range(0.0282 0.0338) ///
    graphregion(color(white)) clstyle(foreground) ||,
    plotregion(style(none))
    legend(off)
    xtitle("Mean sulfur dioxide concentration (ppm)")
    xlabel(0.0284 0.0300 0.0310 0.0317, format(%6.4f))
    ylabel(none)
    yscale(off);
    text(0.0317 206 "Ha", place(ne))
    #delimit cr

  • #2
    I think that you have your order reversed. Should be (y x). You could also add a subscript - if it helps.

    Code:
    text(206 0.0317 "H{sub:0}")

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      I think that you have your order reversed. Should be (y x). You could also add a subscript - if it helps.

      Code:
      text(206 0.0317 "H{sub:0}")
      Thanks Andrew! Unfortunately, the modified code didn't work either. I ran

      #delimit;
      twoway
      function y=normalden(x,0.031,0.0007), range(0.0283509 0.0316491) ///
      bcolor(gs12) recast(area) ||
      function y=normalden(x,0.030,0.0007), range(0.0272 0.0328) ///
      clstyle(foreground) ||
      function y=normalden(x,0.031,0.0007), range(0.0282 0.0338) ///
      graphregion(color(white)) clstyle(foreground) ||,
      plotregion(style(none))
      legend(off)
      xtitle("Mean sulfur dioxide concentration (ppm)")
      xlabel(0.0284 0.0300 0.0310 0.0317, format(%6.4f))
      ylabel(none)
      yscale(off);
      text(206 0.0317 "H{sub:a}")
      #delimit cr


      but there is no text on the figure. Any other ideas?

      Comment


      • #4

        Code:
        #delimit;
        twoway
        function y=normalden(x,0.031,0.0007), range(0.0283509 0.0316491) ///
        bcolor(gs12) recast(area) ||
        function y=normalden(x,0.030,0.0007), range(0.0272 0.0328) ///
        clstyle(foreground) ||
        function y=normalden(x,0.031,0.0007), range(0.0282 0.0338)  /* MOVE HERE */text(206 0.0317 "H{sub:a}") ///
        graphregion(color(white)) clstyle(foreground) ||,
        plotregion(style(none))
        legend(off)
        xtitle("Mean sulfur dioxide concentration (ppm)")
        xlabel(0.0284 0.0300 0.0310 0.0317, format(%6.4f))
        ylabel(none)
        yscale(off);
        #delimit cr

        Comment


        • #5
          Thank you so very much. That works perfectly!

          Comment

          Working...
          X