stata作图,只需要改do文件里面的相关内容就可以
http://www.ats.ucla.edu/stat/stata/library/GraphExamples/code/twospike.htm
sysuse sp500, clear
#delimit ;
twoway line close date, yaxis(1) || spike change date, yaxis(2) ||,
yscale(axis(1) r(700 1400)) ylabel(1000(100)1400, axis(1))
yscale(axis(2) r(-50 300)) ylabel(-50 0 50, axis(2))
ytick(-50(25)50, axis(2) grid)
legend(off)
title("S&P 500")
subtitle("January - December 2001")
note("Source: Yahoo!Finance and Commodity Systems, Inc.")
yline(950, axis(1) lstyle(foreground))
;
#delimit cr
你如果不想标题在上面
sysuse sp500, clear
#delimit ;
twoway line close date, yaxis(1) || spike change date, yaxis(2) ||,
yscale(axis(1) r(700 1400)) ylabel(1000(100)1400, axis(1))
yscale(axis(2) r(-50 300)) ylabel(-50 0 50, axis(2))
ytick(-50(25)50, axis(2) grid)
legend(off)
title("Figure1. S&P 500" ,positon(6))
subtitle("January - December 2001")
note("Source: Yahoo!Finance and Commodity Systems, Inc.")
yline(950, axis(1) lstyle(foreground))
;
#delimit cr
|