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" <>
To   <>
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.  

	-----Original Message----- 
	From: Scott Merryman [] 
	Sent: Sun 6/15/2003 9:02 PM 
	Subject: st: Re: graph, by and xline options

	----- Original Message -----
	From: "Millimet, Daniel" <>
	To: <>
	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-
	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
	Hope this helps,
	*   For searches and help try:


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