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

Consider the following list of countries which I would like to highlight on a world map:


From the documentation center (Country Data > Applications > Application 5), I know that

Graphics[{If[CountryData[#, "AntarcticNations"], Orange, LightBrown], 
    CountryData[#, "SchematicPolygon"]} & /@ CountryData[]]

works for all antarctic nations. I replaced "AntarcticNations" by MyCountries but it does not seem to work.

share|improve this question
up vote 24 down vote accepted

In the example code, CountryData[#, "AntarcticNations"] is a built in predicate that returns True or False. You need something similar for your countries. Perhaps,

  CountryData[#,"SchematicPolygon"]}& /@ CountryData[]]

enter image description here

share|improve this answer
"Bosnia" is not recognized, should be "BosniaHerzegovina". – VLC May 1 '12 at 7:55
I'd like to add that CountryData[#, {"Polygon", "Mollweide"}] allows to set the projection used for the map. – Karsten W. Jul 22 '12 at 12:40

Alternate approach:

  {Orange, CountryData[#, "SchematicPolygon"] & /@ MyCountries}, 
      CountryData[#, "SchematicPolygon"] & /@ Complement[CountryData[], MyCountries]}

which draws all of "your countries" in one color, and then the rest of the world in another.

share|improve this answer

Mathematica 10 introduced new ways to highlight countries on the world map. Examples follow below. There are lots of more examples in the documentation which showcase alternative stylings.

myCountries = Map[
   Entity["Country", #] &,
   {"Germany", "Hungary", "Mexico", "Austria", "Turkey", "SouthKorea", "China"}

GeoListPlot[myCountries, ImageSize -> 800]

Map 1

GeoListPlot[myCountries, GeoBackground -> "ReliefMap", ImageSize -> 800]

Map 2

GeoRegionValuePlot[MapThread[Rule, {myCountries, RandomReal[10, Length@myCountries]}]]

Map 3

 {EdgeForm[Black], FaceForm[Orange], Polygon /@ myCountries},
 ImageSize -> 800

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.