Can Stata Make An Aesthetically Appealing Graph?

stats
dataviz
Author

Andy Grogan-Kaylor

Published

February 5, 2024

Background

Code
library(Statamarkdown)

Another attempt to make an aesthetically appealing graph with Stata.

I make use of the /// notation which allows me to spread the graph along multiple lines.

Get The Data

Code
use "https://github.com/agrogan1/multilevel/raw/master/fixed-effects-example-World-Bank-data/WorldBankData.dta", clear

Data Management

Code
drop if region == "Aggregates" // drop Aggregates

Graph

Code

twoway (scatter GDP year, mcolor(%10)) /// scatterplot; transparent markers
(lowess GDP year, lwidth(thick)),  /// lowess smoother
xlabel(, angle(270) labsize(vsmall)) /// x label tweaks
ylabel(, angle(0) labsize(vsmall)) /// y label tweaks
by(region, title("GDP by Year") ///
note ("World Bank Data: Every Dot is a Country-Year") ///
legend(off)) ///
subtitle(, size(small)) ///
xsize(5) ysize(5) /// x and y size
scheme(michigan) 
    
graph export aesthetically-appealing-World-Bank.svg, width(2000) replace

An Aesthetically Appealing Graph of World Bank Data

An Aesthetically Appealing Graph of World Bank Data