Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: graph, by and xline options


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: Re: graph, by and xline options
Date   Sun, 15 Jun 2003 21:02:25 -0500

----- 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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index