2
$\begingroup$

I am coloring several countries in the manner of the following:

myc[name_] := If[name == "UnitedStates", Red, Lighter[Gray]] 
Graphics[{myc[#], CountryData[#, {"FullPolygon", "WinkelTripel"}]} & /@ CountryData[]] 

How can I add country borders and longitude-latitude grid, as we could do with WorldPlot?

$\endgroup$

1 Answer 1

2
$\begingroup$

Specifying EdgeForm resolves the country borders. Latitude and longitude...well here is a clumsy way. Depending on your desired grid you may have to clean up conversion.

myc[name_] := If[name == "UnitedStates", Red, Lighter[Gray]]
lat = Quiet[
   Line /@ Table[
     Table[GeoGridPosition[GeoPosition[{j, k, 0}], 
        "WinkelTripel"][[1, {1, 2}]], {j, -90, 90, 5}], {k, -170, 170,
       15}]];
long = Quiet[
   Line /@ Table[
     Table[GeoGridPosition[GeoPosition[{k, j, 0}], 
        "WinkelTripel"][[1, {1, 2}]], {j, -170, 170, 15}], {k, -90, 
      90, 10}]];
Graphics[{Gray, lat, long, myc[#], EdgeForm[Black], 
    CountryData[#, {"FullPolygon", "WinkelTripel"}]} & /@ 
  CountryData[]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.