A stata program that makes mapping easy.

by Michael Stepner

maptile provides a simple method for mapping a variable in Stata. It divides the areas on the map into groups and shades them according to the value of the variable being plotted. The map itself is drawn using geography templates, which can be downloaded here. These templates are easy to create and share.


This map shows 2013 age-adjusted mortality rates for white Americans.

maptile example

The map was created by running: maptile mort_white, geo(state)


Open Stata and install maptile by running the commands:

ssc install maptile
ssc install spmap

After installing maptile, you can read the documentation by running help maptile. The Examples section of the help file contains a clickable walk-through of maptile's various features.

Before you can make a map, you will need to install a geography template. There are many freely available here for you to install and use.

Introductory Slide Deck

This slide deck provides a visual introduction to maptile. It explains:

You can also download the source files, which include the Stata code to generate every figure shown in the slide deck.

Technical Description

maptile generates choropleth maps, where each area is shaded according to the value of the variable being plotted. By default, maptile divides the geographic units into equal-sized bins (corresponding to quantiles of the plotted variable), then colors the bins in increasing intensity.

To generate any particular map, maptile uses a 'geography', which is a template for that map. These need to be downloaded and installed. If no geography currently exists for the region you want to map, you can make a new one.

maptile requires spmap to be installed, and is largely a convenient interface for using spmap. As its help file states, "spmap gives the user full control over the formatting of almost every map element, thus allowing the production of highly customized maps". When using maptile, most of these customizations are stored away in the geography template. As a result, the syntax for making highly customized maps using maptile can be very simple. Additionally, the geography templates can be easily shared and used by others.


maptile was built on the shoulders of giants. Maps are generated using spmap, written by Maurizio Pisati. The geography template shapefiles were made using shp2dta, written by Kevin Crow, as well as mergepoly, written by Robert Picard.