Dear All,
I need to create a map of US States with some points (firms) on it. I would like to have a legend for the US Census Districts that give different colors to different groups of states and for the firm groups (symbols x and Th). I used the following code:
spmap census_district using "~$path/uscoord.dta", id(id) ///
clmethod(unique) fcolor(gs6 "255 237 111" "191 211 230" "254 232 200" "188 128 189" "217 217 217" "252 205 229" "128 177 211" "190 186 218" "255 255 179" "141 211 199" "166 206 227" "251 154 153" "253 191 111" "202 178 214" "246 232 195" "199 234 229" "241 182 218" "230 245 152") ///
ocolor(none ..) legend(ring(5) pos(9) size(*1.8) symx(*.85) symy(*.85) row(3) col(3)) ///
point(data("~path/firms.dta") by(indicator) xc(lng) yc(lat) size(small small) shape(X Th) fcolor(red black) legenda(off))
addplot: (scatter census_district nodata1, msize(*1.5) mcolor(red) msymbol(Th)) || (scatter census_district nodata2 , msize(*1.5) mcolor("0 63 92") msymbol(X) norescaling))
Addplot in fact adds a legend for the firms, but overwrites the spmap legend.
Is there a way to keep both legends, in different parts of the map?
Thanks a lot for your help,
Josh
I need to create a map of US States with some points (firms) on it. I would like to have a legend for the US Census Districts that give different colors to different groups of states and for the firm groups (symbols x and Th). I used the following code:
spmap census_district using "~$path/uscoord.dta", id(id) ///
clmethod(unique) fcolor(gs6 "255 237 111" "191 211 230" "254 232 200" "188 128 189" "217 217 217" "252 205 229" "128 177 211" "190 186 218" "255 255 179" "141 211 199" "166 206 227" "251 154 153" "253 191 111" "202 178 214" "246 232 195" "199 234 229" "241 182 218" "230 245 152") ///
ocolor(none ..) legend(ring(5) pos(9) size(*1.8) symx(*.85) symy(*.85) row(3) col(3)) ///
point(data("~path/firms.dta") by(indicator) xc(lng) yc(lat) size(small small) shape(X Th) fcolor(red black) legenda(off))
addplot: (scatter census_district nodata1, msize(*1.5) mcolor(red) msymbol(Th)) || (scatter census_district nodata2 , msize(*1.5) mcolor("0 63 92") msymbol(X) norescaling))
Addplot in fact adds a legend for the firms, but overwrites the spmap legend.
Is there a way to keep both legends, in different parts of the map?
Thanks a lot for your help,
Josh
