That's close, but I think still not ideal since this then either forces one to show a seperate legend under each of the original individual plots, or not have a lend at all, whereas using the by option allows one to show only one legend that applies to all graphs.
Dann
-----Original Message-----
From: Scott Merryman [mailto:[email protected]]
Sent: Sun 6/15/2003 9:02 PM
To: [email protected]
Cc:
Subject: st: Re: graph, by and xline options
----- Original Message -----
From: "Millimet, Daniel" <[email protected]>
To: <[email protected]>
Sent: Sunday, June 15, 2003 7:30 PM
Subject: st: graph, by and xline options
> Hello,
>
> I am using the -twoway connected y x, by(var)- command to generate a graph
with 9 individual plots (3x3). That all works fine, but now I am trying to
add xlines to each of the 9 plots, where the lines are drawn at different
values for each plot. Is this possible? Looking at the axis_selection
section of the manual does not seem to help when using the by option.
>
> Thanks,
> Dann
>
One way is to save each graph and then use -graph combine-
Example:
preserve
sysuse uslifeexp, clear
line le_male year, xline(1939) saving(male)
line le_female year, xline(1956) saving(female)
line le_male year, xline( 1945) saving(male2)
line le_female year, xline(1963) saving(female2)
gr combine male.gph female.gph male2.gph female2.gph
erase male.gph
erase female.gph
erase male2.gph
erase female2.gph
restore
Hope this helps,
Scott
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
<<winmail.dat>>