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

st: combining bar graphs with common legend

From   Daniel Müller <>
To   "Statalist" <>
Subject   st: combining bar graphs with common legend
Date   Fri, 7 Feb 2003 13:14:31 +0100

In Stata 8, I would like to have two bar graphs next to eachtoher with a
common legend. However, I only manage to associate the legend with either
one or with the other graph. But then the two graphs have unequal size. How
can I put a legend below (optionelly to the left of) both graphs? So far I

graph bar (mean) wricehh00 wricehh90 wricehh80, ///
	ti("Wetland rice") ///
	ytitle("Hectares per household") ///
	legend(off) ///
	name(wricehahh, replace) ///

graph bar (mean) uricehh00 uricehh90 uricehh80, ///
	ti("Upland rice") ///
	ytitle("") ///
	legend(stack col(1) pos(3) lab(1 "2000") label(2 "1990") lab(3
"1980")) ///
	name(uricehahh, replace) /// this graph is smaller due to legend

graph combine wricehahh uricehahh, ///
	ycommon xcommon ///
	name(ricehahh, replace) ///

Thanks a lot in advance, greetings,
--- Daniel ---

*   For searches and help try:

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