Click here to see the SAS code.
Click here to see the example.
This example was the "centerfold" of the American Demographics magazine :)
The first thing you'll notice is that it's "bigger" than the other examples.
I do this using "goptions xpixels=1100 ypixels=800;". That way, you can see
more detail, and I have more pixels to work with.
I apply a user-defined format to the 'education' level - this controls the
"binning/grouping" of the data that I plot in the counties, and thereby
controls the color, and the user-defined format labels show up in the
map legend. User-defined formats *rule*! :)
I also use annotate to draw my custom "dot legend" (the blue dots on the
right/bottom of the map) so you have some reference about what the various
sizes of dots represent (it's a pain to do a legend that way, but once
you have the code you can easily re-use it on the next map :).
For the blue dots, I first create a dataset containing the zipcode where I
want the blue dot, and a variable called 'centers' which indicates how many
"nanotech centers" are in that zipcode. I then join/merge that with the
sashelp.zipcode dataset to get the long/lat of the zipcodes, and I convert
the long/lat degrees into 'radians'. I add several variables to the data
set so that it is a sas/graph annotate dataset that will draw a blue
dot ('pie') at each zipcode.
I combine the annotate/pie data set with the map, and "gproject" it, and
then separate the dots and map again, and then use "proc gmap" to draw
the color-coded map, with the blue dots annotated.
I use the gmap html= option to provide html title= charttips/flyover-text when
you mouse over the counties, and I use the annotate "html" variable to
similarly give charttip into when you mouse over the blue dots.
I also set up href's so that you get a mapquest map of the area when you
click on a blue dot, and you get a census report for that state when you
click on a land area.
Back to Samples Index