views:

1530

answers:

8

I have some US demographic and firmographic data.
I would like to plot zipcode areas in a state or a smaller region (e.g. city). Each area would be annotated by color and/or text specific to that area. The output would be similar to http://maps.huge.info/ but a) with annotated text; b) pdf output; c) scriptable in R or Python.

Is there any package and code that allows me to do this?

A: 

Depending on your application, a long way around might be to use something like this:

http://googlemapsmania.blogspot.com/2006/07/new-google-maps-us-zip-code-mashups.html

To map your data. If that wasn't quite what you wanted, you can get raw zip code shapefiles from census.gov and do it manually, which is quite a pain.

Also, if you haven't seen it, this is a neat way to interact with similar data, and might offer some pointers:

http://benfry.com/zipdecode/

Paul McMillan
nice too, but these are visualizations of zip codes locations/boundaries. I am looking for a flexible way in R or Python to generate maps with custom-colored or text-annotated zip regions.
gappy
A: 

Check out this excellent online visualization tool by IBM http://manyeyes.alphaworks.ibm.com/manyeyes/

EDIT FYI, ManyEyes uses the Prefuse visualization toolkit for some of its viz. Even though it is a java-based framework, they also provide a Flash/ActionScript tool for the web.

Amro
that's cool. It has some things in common with http://gapminder.org
Paul McMillan
Isnt that the same thing that was presented by Hans Rosling on TED a few years ago
Amro
nice, but manyeyes doesn't answer my question. I think it's very different from gapminder. Wattenberg is a visualization guy, Rosling is a social scientist, and the different approach shows.
gappy
+2  A: 

Someone may have something more direct for you, but I found O'Reilly's 'Data Mashups in R' very interesting... in part, it's a spatial mapping of home foreclosure auctions.

http://oreilly.com/catalog/9780596804770/

William Doane
Plus, no DRM and only $5...hard to beat that deal!
Stedy
+1  A: 

There is a rich and sophisticated series of packages in R to plot, do analysis, and other functions related to GIS. One place to get started is the CRAN task view on Spatial Data: This is a complex and sometimes arcane world, and takes some work to understand.

If you are looking for a free, very functional mapping application, may I suggest:

MapWindow ( mapwindow.com)

I could not find anything in that CRAN view that would help me visualize zip code statistics on a map. The closest I got was the package muRL.
gappy
+1  A: 

Daniel Levine at TechCrunch Trends has done nice things with the maps package in R. He has code available on his site, too.

Paul's suggestion of looking into Processing - which Ben Fry used to make zipdecode - is also a good one, if you're up for learning a (Java-like) new language.

Matt Parker
Note: the Trends maps are zip-code level.
Matt Parker
thanks Matt, yes the trends maps are zip code level, but instead of shading zipcode areas, I actually mapped the zipcodes to lat/long coords. Anyone is welcome to the code though.
Dan
+6  A: 
Shane
+10  A: 
Eduardo Leoni
Very nice! Thanks for sharing this. I didn't see that question before.
Shane
Thanks a lot. This was really nontrivial.
gappy
A: 

In Python, you can use shapefiles from the US census along with the basemap package. Here is an example of filling in states according to population.

endolith