aesir
aesir

Reputation: 565

Legend options in Stata graphs

http://imageshack.us/photo/my-images/339/41988730.jpg/

I'm trying to figure out how to tweak the options for the legend in this graph (see link above). Specifically I'd like the new = part of the label to disappear. Next to each line I'd like just the name of the company. I'm using the xtline command to generate the graph. Each line on the graph should represent a distinct value of the variable "company" (there should be 11 distinct values).

xtline revenue, overlay t(week_name) i(company)

Thanks!

Upvotes: 1

Views: 25650

Answers (1)

Steve Samuels
Steve Samuels

Reputation: 908

Use the label() sub-option of the legend() option. Here's the example on p. 474 of the Stata 12 manual:

line le_m le_f year, legend(label(1 "Males") label(2 "Females"))

You can also use the order() sub-option to order the legend entries according to the order of the curves on the graph. Type "help graph legend" for more information and links to the Manual.

However I don't find legends with so many entries to be helpful. You'd have a more readable plot if you specify "legend(off)"; "yscale(log)"; and add the appropriate label next to each curve with the Graph Editor.

Upvotes: 4

Related Questions