楼主: 匿名
20374 212

[Stata] [Stata] 如何添加直角坐标系及极坐标系及SDAS_绘图实例 [推广有奖]

191
niuniuyiwan 在职认证  发表于 2015-10-22 08:13:49
  1. set scheme s1color
  2. u cumbrian_cirques, clear
  3. dotplot maxgrad, over(grade) saving(g3, replace asis) ms(Oh) yla(, format(%4.0g))
复制代码

Graph.png


192
niuniuyiwan 在职认证  发表于 2015-10-22 08:16:00
  1. set scheme s1color
  2. u cumbrian_cirques, clear


  3. separate length, by(grade) veryshortlabel
  4. scatter length? width, xsc(log) ysc(log) ms(O ..) ///
  5. mcolor(gs1 gs4 gs7 gs10 gs13) mlcolor(black ..) ///
  6. msize(*1.5 ..) yti("`: variable label length'") ///
  7. yla(200 500 1000 2000) xla(200 500 1000 2000) ///
  8. legend(pos(11) ring(0) col(1)) saving(g4, asis replace)
复制代码

Graph.png


  1. scatter length? width, xsc(log) ysc(log) ms(O ..) ///
  2. mcolor(gs1 gs4 gs7 gs10 gs13) mlcolor(black ..)  ///
  3. msize(*1.5 ..) yti("`: variable label length'", ///
  4. orient(horiz)) yla(200 500 1000 2000, ang(h)) ///
  5. xla(200 500 1000 2000) legend(pos(11) ring(0) ///
  6. col(1)) ysc(titlegap(-10)) saving(g5, asis replace)
复制代码

g5.png


193
niuniuyiwan 在职认证  发表于 2015-10-22 08:20:08
  1. set scheme s1color
  2. u cumbrian_cirques, clear

  3. dotplot maxgrad, over(grade) saving(g6, replace asis)   ///
  4. ms(Oh) yla(, ang(h) format(%4.0g)) xla(, ang(-.001) tlcolor(none))
复制代码

g6.png



194
niuniuyiwan 在职认证  发表于 2015-10-22 08:22:00
  1. set scheme s1color
  2. u cumbrian_cirques, clear

  3. forval i = 1/5 {
  4.     scatter length width if grade != `i', xsc(log) ysc(log) xla(200 500 1000 2000) yla(200 500 1000 2000) ms(oh) mc(blue*0.2) ///
  5.     || scatter length width if grade == `i', xsc(log) ysc(log) xla(200 500 1000 2000) yla(200 500 1000 2000) ///
  6.     ms(O) mc(blue) yla(, ang(h)) subtitle("`: label (grade) `i''", place(w)) legend(off) name(g11_`i', replace)
  7. }

  8. scatter length width, xsc(log) ysc(log) xla(200 500 1000 2000) yla(200 500 1000 2000) ms(O) mc(blue) yla(, ang(h)) name(g11_6, replace) subtitle("all", place(w))   

  9. graph combine g11_1 g11_2 g11_3 g11_4 g11_5 g11_6, saving(g11, asis replace) imargin(small)
复制代码

g11.png



195
niuniuyiwan 在职认证  发表于 2015-10-22 08:23:10
  1. set scheme s1color
  2. u cumbrian_cirques, clear


  3. circdplot wallasp, by(grade) width(2) saving(g17, asis replace)
复制代码

Graph.png



196
niuniuyiwan 在职认证  发表于 2015-10-22 09:16:34
  1. set scheme s1color
  2. u cumbrian_cirques, clear
  3. net install gr42_6, from(http://www.stata-journal.com/software/sj12-1)
  4. qplot  length width, by(grade, legend(at(6) pos(0))) legend(col(1)  ///
  5. region(lcolor(none)) size(*1.3) rowgap(*3)) ysc(log) ///
  6. yla(200 500 1000 2000, ang(h)) saving(g22, asis replace)
复制代码

g22.png



197
niuniuyiwan 在职认证  发表于 2015-10-22 09:18:08
  1. sysuse citytemp, clear
  2. scatter tempjan tempjuly, yla(14 50 68 86, ang(h)) ///
  3. yla(32, custom add labsize(*1.4) ang(h)) xla(59(9)95) ///
  4. ms(Oh) subtitle({char 176}F, place(w) size(*1.4)) ///
  5. yli(32, lw(*.6) lc(gs12)) saving(g7, asis replace)
复制代码

Graph.png



198
niuniuyiwan 在职认证  发表于 2015-10-22 09:30:12
  1. webuse turksales
  2. #delimit;
  3. twoway connected sales t , xtick(119.5(4)159.5, grid glcolor(gs12)  glw(*.5)
  4. tlength(*1.5)) xlabel(121.5(4)157.5, noticks format(%tqCY))  xtitle("")
  5. yla(, ang(h)) saving(g8, asis replace);
  6. #delimit cr
复制代码

Graph.png



199
niuniuyiwan 在职认证  发表于 2015-10-22 09:34:18
  1. webuse womenwage
  2. levelsof wage, local(levels)
  3. histogram wage, start(0) width(5) freq yla(, ang(h)) ///
  4. xtic(`levels', tlength(*1.5) tpos(inside)) ysc(r(-8)) ///
  5. saving(g9, asis replace)
复制代码

G9.png



200
niuniuyiwan 在职认证  发表于 2015-10-22 09:36:02
  1. u cipolla2
  2. local yti "% newly married unable to write their names"
  3. foreach n of num 2 5 10(10)80 {
  4.     local label `label' `=logit(`n'/100)' "`n'"
  5. }
  6. keep if year >= 1854
  7. line logit_Italy_females logit_Italy_males logit_France_females logit_France_males ///
  8. logit_Scotland_females logit_Scotland_males year, legend(pos(3) col(1) size(*0.8)) ///
  9. xla(1860(10)1900) xtitle("") yla(`label', ang(h)) ytitle(`yti') lp(solid dash solid ///
  10. dash solid dash) saving(g10, asis replace)
复制代码

Graph.png



您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 00:37