I'm using spmap, shp2dta and colorpalette from SSC.
I'm trying to create a world map using spmap, with each country colored with their respective data (variable total_worker). Below is the code that I'm using to create the map:
Here world_coord is the coordinates that I created using the command:
However, variable total_worker contains missing variable for some countries. Right now the graph looks like the following:

I'd want the white "No data" countries to be grey in color, and have the outline color to be white, just like other countries. How can I customize the color of the countries that has missing variable value?
I'm trying to create a world map using spmap, with each country colored with their respective data (variable total_worker). Below is the code that I'm using to create the map:
Code:
colorpalette viridis, n(12) nograph reverse local colors `r(p)' drop if country=="Antarctica" spmap total_worker using world_coord, id(id) clbreaks(0 5001 20001 50001 150001 1000000 50000000) clmethod(custom) /// legend(pos(7) size(2.8) region(fcolor(gs15)) label(2 "0 to 5000") label(3 "5001 to 20000") label(4 "20001 to 50000" ) label(5 "50001 to 150000" ) label(6 "150001 to 1000000" ) label(7 "1000000+" )) /// fcolor("`colors'") ocolor(white ..) osize(0.05 ..) title("2017", size(5))
Code:
shp2dta using "world_countries_2020", database(world_db) coordinates(world_coord) genid(id) replace
I'd want the white "No data" countries to be grey in color, and have the outline color to be white, just like other countries. How can I customize the color of the countries that has missing variable value?
Comment