Announcement

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

  • Change name of legend

    Hi!

    How do I change the name of my legend? I want it to say that my line is for women, even if i only have one line.

    regress HGB Total_CO2
    twoway (lfit HGB Total_CO2, lcolor(red) lpattern(dash)), legend(label (1 "Women")) ///
    ytitle(Hemoglobin) xtitle("Dietary GHGE (kg/day)")

    Thank you!!!

  • #2
    As you were directed in https://www.statalist.org/forums/for...ppress-legends

    Comment


    • #3
      I changed it but it still not appears:

      regress HGB Total_CO2
      twoway (lfit HGB Total_CO2, lcolor(red) lpattern(dash)), legend(order(1 "Women")) ///
      ytitle(Hemoglobin) xtitle("Dietary GHGE (kg/day)")

      Comment


      • #4
        Stata suppresses the legend if there is only 1 item. The rationale is that this information is better expressed in the title or the y-axis title. But here is how to turn it on.

        Code:
        regress HGB Total_CO2
        twoway (lfit HGB Total_CO2, lcolor(red) lpattern(dash)), legend(on order(1 "Women")) ///
        ytitle(Hemoglobin) xtitle("Dietary GHGE (kg/day)")

        Comment


        • #5
          Thank you!!!

          Comment

          Working...
          X