// // prepared for the Stata Switzerland 2022 conference (18 Nov 2022) // Asjad Naqvi (asjadnaqvi@gmail.com) // clear // get the packages ssc install schemepack, replace ssc install palettes, replace ssc install colrpsace, replace // set up the defaults set scheme white_tableau graph set window fontface "Arial Narrow" **************************** *** CIRCLE BAR *** **************************** net install circlebar, from("https://raw.githubusercontent.com/asjadnaqvi/stata-circlebar/main/installation/") replace use "https://github.com/asjadnaqvi/stata-circlebar/blob/main/data/cbardata.dta?raw=true", clear circlebar deathspm, by(month) circlebar deathspm, by(month) radmin(0) circlebar deathspm, by(month) radmin(8) radmax(20) circlebar deathspm, by(month) palette(CET C6, n(12)) circlebar deathspm, by(month) palette(CET C6, n(12) reverse) alpha(90) circlebar deathspm, by(month) palette(CET C6, n(12) reverse) alpha(90) lc(black) lw(0.1) circlebar deathspm, by(month) palette(CET C6, n(12)) circ(10) circlebar deathspm, by(month) palette(CET C6, n(12)) circ(10) circc(gs13) circlebar deathspm, by(month) palette(CET C6, n(12)) circlebar deathspm, by(month) palette(CET C6, n(12)) gap(0.5) circlebar deathspm, by(month) palette(CET C6, n(12)) gap(1) radmin(4) radmax(10) text(0 0 "Global COVID-19" "deaths per million" "in 2021", size(2.5)) note("Source: Our World in Data", size(2)) circlebar deathspm, by(month) stack(continent) palette(tab Color Blind, n(6)) gap(0.5) radmin(4) radmax(10) text(0 0 "Global COVID-19" "{bf:deaths per million}" "in 2021" "(by continent)", size(2.5)) note("Source: Our World in Data", size(2)) circ(8) circc(gs13) labgap(8) rotatelab labs(2.4) *********************** *** SPIDER *** *********************** net install spider, from("https://raw.githubusercontent.com/asjadnaqvi/stata-spider/main/installation/") replace use "https://github.com/asjadnaqvi/stata-spider/blob/main/data/spider_test.dta?raw=true", clear drop index_AUS index_LAC // can also keep these gen year = year(date) drop index_AUS index_LAC gen year = year(date) spider index*, over(policy) spider index*, over(policy) alpha(0) rot(45) spider index*, over(policy) alpha(0) msym(none) ra(20 70) cuts(6) rot(45) spider index* if year==2021, over(policy) msym(Oh) lw(0.4) ms(0.4) ra(0 100) spider index*, over(policy) ra(10 80) cuts(8) spider index*, over(policy) ra(10 80) cuts(8) smooth(0) spider index*, over(policy) ra(10 80) cuts(8) smooth(1) spider index*, over(policy) ra(10 80) cuts(8) smooth(0.1) palette(tab Color Blind) lw(0.4) ms(0.6) alpha(0)