Code:
clear
input _X _Y
-86.82805 33.527872
-86.260844 32.331872
-149.7621 61.1919
-147.56838 64.81859
-112.08791 33.494514
-114.08271 35.285985
-92.294471 34.766541
end
save location, replace
copy https://www2.census.gov/geo/tiger/GENZ2015/shp/cb_2015_us_state_500k.zip cb_2015_us_state_500k.zip, replace
unzipfile cb_2015_us_state_500k.zip, replace
shp2dta using cb_2015_us_state_500k, data("us_data") coor("us_coordinates") genid(id) gencentroids(c) replace
use us_data, clear
quietly destring STATEFP, generate(fips)
drop if fips > 56
save usstates,replace
l fips id if fips == 2 | fips == 15
use us_coordinates,clear
gen order = _n
drop if _X < -165 & _X != . & _ID == 50
replace _X = _X + 55 if _X != . & _ID == 50
replace _Y = _Y + 4 if _Y != . & _ID == 50
replace _X = _X*.4 -55 if _X != . & _ID == 15
replace _Y = _Y*.4 + 1 if _Y != . & _ID == 15
drop if _X > -10 & _X != . & _ID == 15
sort order
sort _ID
drop order
save us_coordinates2,replace
use usstates,clear
spmap using us_coordinates2 , id(id) point(data("location.dta") x(_X) y(_Y) shape(triangle) size(*1.0) fcolor(lime) ocolor(white) osize(vvthin))
No comments:
Post a Comment