Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To build an animated cartogram, scale each geographic region according to a measured value, interpolate each region from its original size to its target size, and export the resulting frames. The QGIS workflow below creates a non-contiguous cartogram: each region keeps its general shape, but regions can separate and no longer preserve the map’s original adjacency.

What an animated cartogram shows

A cartogram changes the area of geographic regions to represent a thematic variable. In an animated cartogram, that change unfolds over time—often from the familiar geographic map to a view in which area reflects a chosen measure. This is different from an ordinary map animation that moves points or changes colors while geographic boundaries remain fixed.

The QGIS approach described here scales polygons independently. It is therefore a non-contiguous cartogram, not a contiguous cartogram that reshapes regions while keeping neighbors connected. That distinction affects both recognizability and interpretation: scaled regions may develop gaps, and distances or familiar outlines should not be read as geographically exact.

Build a non-contiguous cartogram in QGIS

The published QGIS example uses U.S. state polygons and population data. It combines 2018 state boundaries with a population-estimates dataset spanning 2020–2023, so treat it as a demonstration of the workflow rather than a claim that these are the latest available data. See the QGIS tutorial for its source files and expressions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Learn QGIS: Your step-by-step guide to the fundamental of QGIS 3.4, 4th Edition
  • Learn QGIS: Your stepbystep guide to the fundamental of QGIS 3.4, 4th Edition
  • ABIS BOOK
  • Packt Publishing

1. Prepare and join the boundary and data files

  1. Download state polygon boundaries and a separate population-estimates table from the U.S. Census Bureau, selecting a population field and year or period appropriate to your project.
  2. Load the shapefile and CSV into QGIS.
  3. Create a padded, two-digit state identifier in the table so its values match the state identifiers in the polygon layer. Check that identifiers are treated consistently as text or numbers before joining.
  4. Join the table to the state polygons using the matching identifier. Confirm the joined population field is populated for the intended states before proceeding.

2. Use an appropriate projection and choose the mapped measure

  1. Reproject the joined layer to North America Albers Equal Area Conic before calculating polygon area. Area-based calculations on an unsuitable coordinate system can produce misleading results.
  2. Calculate a density field as population divided by polygon area if the intended visual comparison is density. If the purpose is to make area represent total population, use population itself as the mapped measure instead; these choices tell different stories.
  3. Select an anchor region for the scale calculation. The tutorial cautions that using an extreme, small, high-density region as the anchor can make the other regions shrink excessively. Choose an anchor that produces a legible range of sizes.

3. Calculate and apply each region’s target scale

For a mapped value V and anchor value A, the example derives a scale factor from the ratio of their square roots: √(V/A). This makes the scaled area proportional to the value, since area changes with the square of a linear scale. A factor of 1 leaves a feature at its original size; factors above or below 1 enlarge or reduce it.

Apply the factor around an interior representative point rather than an arbitrary map origin. For multipart regions, such as a state with islands, scale each part around its own representative point to avoid poor placement. The tutorial uses a QGIS geometry expression to apply the factor; consult its expression and adapt the field names to your layer.

4. Interpolate the transformation over time

  1. Open QGIS’s Temporal Controller and configure a time range for the animation.
  2. Use a time-based linear interpolation expression to transition each feature’s scale from 1 at the start to its target factor at the end. This produces intermediate geometries rather than a single jump from original to transformed size.
  3. Preview the sequence and check that features remain visible and interpretable throughout the transition. The source tutorial demonstrates this approach; it is not an independent test of every QGIS version or configuration.

5. Export and assemble the frames

Export animation frames from QGIS, then assemble them into a GIF with an external GIF maker, as in the tutorial. A video can also be assembled from frames. QGIS export options and external services can change, so check the current interface and service requirements before relying on a particular setting or tool.

Make the changing map understandable

A well-scaled animation can still mislead if readers cannot tell what the area means or compare regions reliably. Good-practice guidance in the cited cartogram paper recommends choosing a numeric measure that adds to an interpretable total, showing a conventional map alongside the cartogram, and using the same color scheme in both. It also recommends indicating missing data, including a legend that communicates the variable’s magnitude, and supporting reader interaction in electronic maps. See the cartogram design guidance.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • State the variable, its units, the time period, and the geographic units represented.
  • Explain whether the map scales total values or a derived measure such as density.
  • Show missing data explicitly rather than allowing an unmarked region to look like a low value.
  • Keep a conventional map available as a geographic reference, using matching colors where possible.
  • Warn readers that the scaled geometry does not preserve geographic distance and, in this non-contiguous method, does not preserve adjacency.

When a time-series map tool is—and is not—the right choice

CARTO’s Time Series Widget offers timestamped playback for moving geometries, but its documentation does not describe it as a tool for the polygon-resizing transformation above. It says animation is unavailable for aggregated sources such as heatmaps, clusters, H3, or quadbin; it also recommends animation primarily for geometries that move over time. For static boundaries with changing attributes, CARTO recommends grouping by geometry to avoid duplicate geometries and using date parameters where appropriate. See the CARTO Time Series Widget documentation.

Approach Best fit Key trade-off
QGIS polygon scaling and temporal interpolation Animating region areas to represent a measured value Requires joined data, suitable area calculations, geometry expressions, and care with region placement; this example allows gaps between regions.
CARTO Time Series Widget Playing back timestamped geometries or viewing changing attributes on static boundaries Its documented purpose is time-series mapping, not the QGIS-style polygon-resizing cartogram transformation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the method around the story

Before building, decide whether preserving neighbor adjacency is essential: if it is, the non-contiguous scaling workflow here is not the right cartogram method. Also distinguish changing region size from moving objects or changing values on fixed boundaries. Then weigh the GIS preparation and expression work against the audience’s need to identify places, compare values, and control playback. An exported GIF or video is easy to distribute, while interactive playback lets readers inspect a sequence at their own pace.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.