Graphics Programs Reference
In-Depth Information
is the estimated percentage of people in the county who are unemployed.
For the purposes of this example, you care only about the county id (that is,
FIPS codes) and the rate.
Now for the map. In previous examples, you generated base maps in R, but
now you can use Python and SVG to do this. The former is to process the
data, and the latter is for the map itself. You don't need to start completely
from scratch, though. You can get a blank map from Wikimedia Commons
found here: http://commons.wikimedia.org/wiki/File:USA_Counties_with_FIPS_
and_names.svg , as shown in Figure 8-15. The page links to the map in four
sizes in PNG format and then one in SVG. You want the SVG one. Download
the SVG file and save it as counties.svg , in the same directory that you save
the unemployment data.
FIGurE 8-15 Blank U.S. county map from Wikimedia Commons
The important thing here, if you're not familiar with SVG, is that it's actu-
ally an XML file. It's text with tags, and you can edit it in a text editor like
you would an HTML file. The browser or image viewer reads the XML, and
the XML tells the browser what to show, such as the colors to use and
shapes to draw.
Search WWH ::




Custom Search