What would a minimal example for a choropleth map in Mathematica look like?
I can read in a ESRI Shapefile using Import
, but do not know how to work with th
Graphics[
{
ColorData["ThermometerColors"][
Rescale[CountryData[#, "GDPPerCapita"], {100, 50000}]
] /. HoldPattern[Blend[___]] -> Yellow,
CountryData[#, "Polygon"]
} & /@
CountryData[]
]
And why the replacement? If there are no data of the required type for a given country CountryData returns Missing["NotAvailable"], causing ColorData
, and its underlying Blend
function not to return a specific RGB value. I replace this unevaluated Blend
with the color Yellow.