Lee_iris 发表于 2023-5-26 12:58 
中间的代码有点乱了,和网站本身的代码有点冲突
你好,请问一下 可以解释一下这个命令嘛yaxis和xaxis
twoway (line le_wmale year, yaxis(1 2) xaxis(1 2))
(line le_bmale year)
(line diff year)
全部代码为:
sysuse uslifeexp, clear
gen diff = le_wmale - le_bmale
label var diff "寿命差异"
#delimit ;
twoway (line le_wmale year, yaxis(1 2) xaxis(1 2))
(line le_bmale year)
(line diff year)
,
ylabel(0 20(10)80, gmax angle(0))
ylabel(0(5)20, axis(2) gmin angle(0))
xlabel(1918, axis(2))
title("图2:白人和黑人预期寿命")
subtitle("美国, 1900-1999")
ytitle("预期寿命 (年)")
xtitle("年份")
ytitle("", axis(2))
xtitle("", axis(2))
note("数据来源: 美国国家重要统计资料报告, 第5卷-第6期"
"(1918 巨降: 源于1918年全国性流行感冒)",linegap(1.2))
legend(label(1 "白人男性") label(2 "黑人男性")
rows(1) size(*0.7));
#delimit cr