Click here to see the SAS code. 
Click here to see the example. 

This sample shows something I've heard users ask for over & over.
"Can sas do gradient/shaded maps?"  This example proves that the
answer is yes!  :-)

And now, for the details...

I originally got the SO4 data from the IML guys.
The key to this data is that it is identified down to the county level.
Basically, I do a gmap, using the maps.uscounty sas/graph map data set
that is supplied with sas.  I let the outlines of the counties be the
same color as the data (rather than specifying coutline='black').  But
the person viewing the map does need "some" level of geographical boundary 
so they can make sense of the map, so I use 'annotate' to add the 
outlines of the states.  Plotting the data down to the county level, 
but drawing the borders at the state level (with annotate) is what gives 
the "illusion" of the smooth gradient shading.  

I also use gmap's "html=" option to add html title= charttip/flyover-text.
You can mouse over each county and see the county name and the SO4 value
for that county.  Note that I used SAS SQL to merge in the county names
from the maps.cntynm data set (otherwise I would have just had the numeric
county FIPs code, which most people can't relate to).

And, a few other finishing touches worth mentioning, in the titles...
I use the title statement's "link=" to put drilldown links to the
proc gmap and ods html pages in the title2 statement.  I use the
"move=" in the title1 to subscript the '4' in the 'SO4'.

Note that you should be able to easily re-use this sas code to do a 
similar map with *any* data which you have down to the county level!

Alternatively, if you have a grid of longitude/latitude locations for
your data, rather than 1 value for each county, you can use the 'annotate'
technique shown in democd5 in the "US Elevation Contour" example.


Back to Samples Index