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

st: RE: Re: graph, by and xline options


From   "Millimet, Daniel" <millimet@mail.smu.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Re: graph, by and xline options
Date   Sun, 15 Jun 2003 21:18:36 -0500

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:smerryman@kc.rr.com] 
	Sent: Sun 6/15/2003 9:02 PM 
	To: statalist@hsphsun2.harvard.edu 
	Cc: 
	Subject: st: Re: graph, by and xline options
	
	

	----- Original Message -----
	From: "Millimet, Daniel" <millimet@mail.smu.edu>
	To: <statalist@hsphsun2.harvard.edu>
	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>>




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