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 <d.mueller@agr.uni-goettingen.de>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
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
have:

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

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
	scheme(sj)

graph combine wricehahh uricehahh, ///
	ycommon xcommon ///
	name(ricehahh, replace) ///
	scheme(sj)
--------------------------end---

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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index