Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Multiple bar/rcap graphs as 1 file


From   "Daniel Exeter" <[email protected]>
To   <[email protected]>
Subject   st: Multiple bar/rcap graphs as 1 file
Date   Mon, 21 May 2007 17:20:55 +1200

Dear all, 

I use the following excerpt of a do file to generate a series of graphs
(1 national and 5 regional)

Each graph has its own title etc, but is set to the same X and Y scales

At present, I get 1 figure for each state/sex/age group combination,
which is great. However for publication, it would be great to get 1
figure which combines the 6 graphs as 2 wide and 3 deep. 

Can anybody please suggest the code to do this? 

Cheers
Dan


 twoway (bar rate var1  if var2==1, bfc(gs15)) ///
          (bar rate var1 if var2==2, bfc(gs10)) ///
          (bar rate var1 if var2==3, bfc(gs1)) ///
          (rcap ub1 lb1 var1, bfc(gs10)), ///
          title("`atitle' `btitle'") ///
          subtitle("`ctitle' `dtitle' ") ///
         legend( order(1  2 3 4) ) ///
          xlabel(" ") ///
       ylabel(0(`rng')`max') xtitle() ytitle("") ///
	 graph export "`a'fig.wmf", replace


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