Announcement

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

  • Suppress legend on twoway graph

    I'm generating a graph with lines of best fit and it works fine but when I try and suppress the legend I get an error message. If use:
    Code:
    tw((lfitci sales year if Dense==1 & year<2008, lp(dash)) (lfitci sales year if Sparse==1 & year<2008)(lfitci sales year if Dense==1 & year>=2008, lp(dash)) (lfitci sales year if Sparse==1 & year>=2008))
    I have no problems. But as soon as I change it to
    Code:
    tw((lfitci sales year if Dense==1 & year<2008, lp(dash)) (lfitci sales year if Sparse==1 & year<2008)(lfitci sales year if Dense==1 & year>=2008, lp(dash)) (lfitci sales year if Sparse==1 & year>=2008)), leg(off)
    I get an error message saying "lfitci is not a twoway plot type". Thoughts?

  • #2
    Tim: I think you need the leg(off) inside the parens for your rightmost command, i.e.
    Code:
    (lfitci sales year if Sparse==1 & year>=2008, leg(off))

    Comment


    • #3
      Funny enough,that's how I had it initially and got the same errors, so that's when I moved it out. I never did figure it out. I just manually removed the legend using the options inside of Stata.

      Comment

      Working...
      X