Function Repository Resource:

# Cartogram

Generate geometrically distorted maps, where the distortion conveys information derived from the input data

Contributed by: Richard Lapin
 ResourceFunction["Cartogram"][reg] generates a plot of width 100 in which geographic region reg specified in the form of an Entity object are displayed after 30 iterations; the destortion is based on equalising the population densities by default. ResourceFunction["Cartogram"][{reg1→val1,reg2→val2,…}] generates a plot in which geographic regions reg1 and reg2 specified in the form of Entity objects are displayed after 30 iterations, where the distortion is based on the values val1 and val2. ResourceFunction["Cartogram"][reg,iterations] generates a plot in which geographic region reg is displayed after the specified number of iterations. ResourceFunction["Cartogram"][reg,iterations,res] generates a plot of width res. ResourceFunction["Cartogram"][reg,iterations,res,plotAll] generates a list of plots of width res from the undistorted map to the specified number of iterations.

## Details and Options

The reg can be Entity objects such as countries corresponding to extended geographic regions or geometric constructs with GeoPosition coordinates.
The val must be a number.

## Examples

### Basic Examples (3)

Cartogram works with a single geographic entity:

 In[1]:=
 Out[1]=

A list of countries:

 In[2]:=
 Out[2]=

A list of countries using user-input values:

 In[3]:=
 Out[3]=

### Options (3)

Run Cartogram for just one iteration:

 In[4]:=
 Out[4]=

Run it for five iterations with a width of 400 pixels.

 In[5]:=
 Out[5]=

Return all steps of first five iterations:

 In[6]:=
 Out[6]=

Richard Lapin

## Version History

• 1.0.0 – 10 July 2019

## Author Notes

High resolution iterations are computationally intensive and take a long time. For instance, 500 iterations of contiguous US states at resolution of 1000 took around 3 hours (link for the output below): https://youtu.be/ggcOGzDh1qo