Stata的绘图主题

Stata的绘图主题

在这篇文章中我收集了几乎所有的Stata主题,其中目前自己最喜欢的是plotplain主题。

blindschemes

安装

Stata
1
2
3
ssc install blindschemes, replace all
* 这个包里有两个主题,plottig和plotplainblind
sysuse sp500, clear

plottig

Stata
1
2
line close date, sort sch(plottig)
gr export scheme1.png, replace



Stata
1
2
hist close, sch(plottig)
gr export scheme2.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(plottig)
gr export scheme3.png, replace

plottigblind

Stata
1
2
line close date, sort sch(plottigblind)
gr export scheme4.png, replace

Stata
1
2
hist close, sch(plottigblind)
gr export scheme5.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(plottigblind)
gr export scheme6.png, replace

plotplain

Stata
1
2
line close date, sort sch(plotplain)
gr export scheme7.png, replace

Stata
1
2
hist close, sch(plotplain)
gr export scheme8.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(plotplain)
gr export scheme9.png, replace

plotplainblind

Stata
1
2
line close date, sort sch(plotplainblind)
gr export scheme10.png, replace

Stata
1
2
hist close, sch(plotplainblind)
gr export scheme11.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(plotplainblind)
gr export scheme12.png, replace

scheme-tfl

Stata
1
2
3
4
5
// 安装
ssc install scheme-tfl, replace

line close date, sort sch(tfl)
gr export scheme13.png, replace

Stata
1
2
hist close, sch(tfl)
gr export scheme14.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(tfl)
gr export scheme15.png, replace

burd/burd3-burd11

Stata
1
2
3
4
5
6
// 安装
ssc install scheme-burd, replace

sysuse auto, clear
spineplot foreign rep78, sch(burd)
gr export scheme16.png, replace

Stata
1
2
spineplot rep78 foreign, sch(burd6)
gr export scheme17.png, replace

Stata
1
2
tw sc price weight, sch(burd10)
gr export scheme18.png, replace

Stata
1
2
gr matrix price weight rep78, sch(burd8)
gr export scheme19.png, replace

virdis

Stata
1
2
3
4
5
6
// 安装
net install scheme_virdis, from(https://raw.github.com/vikjam/stata-scheme-virdis/master/) replace

sysuse sp500, clear
line close date, sort sch(virdis)
gr export scheme20.png, replace

Stata
1
2
hist close, sch(virdis)
gr export scheme21.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(virdis)
gr export scheme22.png, replace

michigan

Stata
1
2
3
4
5
6
// 安装
net install michigan, from("http://www-personal.umich.edu/~agrogan/stata/programs")

sysuse sp500, clear
line close date, sort sch(michigan)
gr export scheme23.png, replace

Stata
1
2
hist close, sch(michigan)
gr export scheme24.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(michigan)
gr export scheme25.png, replace

mrc

Stata
1
2
3
4
5
6
// 安装
net install scheme-mrc.pkg

sysuse sp500, clear
line close date, sort sch(mrc)
gr export scheme26.png, replace

Stata
1
2
hist close, sch(mrc)
gr export scheme27.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(mrc)
gr export scheme28.png, replace

tufte

Stata
1
2
3
4
5
6
// 安装
net install scheme_tufte.pkg

sysuse sp500, clear
line close date, sort sch(tufte)
gr export scheme29.png, replace

Stata
1
2
hist close, sch(tufte)
gr export scheme30.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(tufte)
gr export scheme31.png, replace

scheme_rbn1mono

  • 该主题包中有四个主题,分别是rbn1mono到rbn4mono
    Stata
    1
    2
    3
    4
    5
    net install scheme_rbn1mono.pkg, from("http://fmwww.bc.edu/RePEc/bocode/s/")

    sysuse sp500, clear
    line close date, sort sch(rbn1mono)
    gr export scheme32.png, replace

Stata
1
2
hist close, sch(rbn1mono)
gr export scheme33.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(rbn1mono)
gr export scheme34.png, replace

Stata
1
2
3
line close date, sort sch(rbn2mono)
hist close, sch(rbn2mono)
gr export scheme35.png, replace

Stata
1
2
3
4
tw sc close date, sort mc(red) || ///
sc open date, sort mc(green) ||, ///
sch(rbn2mono)
gr export scheme36.png, replace

《A Visual Guide to Stata Graphics, Third Edition》书中提供的主题

  • 安装
    1
    2
    net from “http://www.stata-press.com/data/vgsg3/”
    net install vgsg3
Stata
1
vguse allstates, clear

vg_s1c

Stata
1
2
sc propval100 rent700 ownhome, sch(vg_s1c)
gr export vg_s1c.png, replace

vg_s1m

Stata
1
2
sc propval100 rent700 ownhome, sch(vg_s1m)
gr export vg_s1m.png, replace

vg_s2c

Stata
1
2
3
4
5
vguse nlsw, clear
gr hbox wage, over(grade) asyvar nooutsides ///
leg(rows(2)) sch(vg_s2c)
* asyvars specifies that the first over() group be treated as yvars.
gr export vg_s2c.png, replace

vg_s2m

Stata
1
2
3
gr hbox wage, over(grade) asyvar nooutsides ///
leg(rows(2)) sch(vg_s2m)
gr export vg_s2m.png, replace

vg_palec

1
2
3
4
gr hbar wage, over(occ7, label(nolabels)) blabel(group, pos(base)) sch(vg_palec)
* blabel(group, pos(base)): place label inside the bar at the bar's base. (outside/inside/base/center)
gr export vg_palec.png, replace
`

  • vg_palem
    Stata
    1
    2
    gr hbar wage, over(occ7, label(nolabels)) blabel(group, pos(inside)) sch(vg_palem)
    gr export vg_palem.png, replace

vg_outc

Stata
1
2
3
vguse allstates, clear
sc propval100 rent700 ownhome, sch(vg_outc)
gr export vg_outc.png, replace

vg_outm

Stata
1
2
sc propval100 rent700 ownhome, sch(vg_outm)
gr export vg_outm.png, replace

vg_lgndc

Stata
1
2
gr hbar commute, over(division) asyvar sch(vg_lgndc)
gr export vg_lgndc.png, replace

vg_past

Stata
1
2
gr hbar commute, over(division) asyvar leg(r(3)) sch(vg_past)
gr export vg_past.png, replace

vg_rose

Stata
1
2
tw sc rent700 propval100, sch(vg_rose)
gr export vg_rose, replace

vg_blue

Stata
1
2
gr bar commute, over(division) asyvar leg(r(3)) sch(vg_blue)
gr export vg_blue.png, replace

vg_teal

Stata
1
2
gr bar commute, over(division) asyvar leg(r(3)) sch(vg_teal)
gr export vg_teal.png, replace

vg_brite

Stata
1
2
gr bar commute, over(division) asyvar leg(r(3)) sch(vg_brite)
gr export vg_brite.png, replace

# Stata

评论

程振兴

程振兴 @czxa.top
截止今天,我已经在本博客上写了607.9k个字了!

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×