Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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,
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"}]} & /@ 

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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