大白菜2012 发表于 2012-10-28 22:45 
see this example,
Assuming your variables are called the following:
求指点迷津,参照stata英文手册graph--graph twoway bar ,编写同意的命令在doeditor中,无法正常运行,应该是命令过长,语法错误,求解
use
http://www.stata-press.com/data/r11/pop2000, clear
replace maletotal = -maletotal/1e+6
replace femtotal = femtotal/1e+6
generate zero = 0
twoway
bar maletotal agegrp, horizontal xvarlab(Males)
||
bar femtotal agegrp, horizontal xvarlab(Females)
||
sc agegrp zero , mlabel(agegrp) mlabcolor(black) msymbol(i)
||
, xtitle("Population in millions") ytitle("")
plotregion(style(none)) (note 1)
ysca(noline) ylabel(none) (note 2)
xsca(noline titlegap(-3.5)) (note 3)
xlabel(-12 "12" -10 "10" -8 "8" -6 "6" -4 "4" 4(2)12 , tlength(0)
grid gmin gmax)
legend(label(1 Males) label(2 Females)) legend(order(1 2))
title("US Male and Female Population by Age, 2000")
note("Source: U.S. Census Bureau, Census 2000, Tables 1, 2 and 3")