Click here to see the SAS code.
Click here to see the example.
I start with the maps.states US map, since it has long/lat boundaries,
and I can therefore combine it with the long/lat coordinates of the
nuclear plants and have them show up in the correct location.
I use a user-defined format to make the numeric values for the percent
of nuclear power in each state show up as the desired value range
in the legend - also each range gets a color in the map.
(I use the gmap midpoints= option to make sure all the ranges
show up in the legend.)
The html charttips for the states are kind of clever...
I loop through the data and create a combined charttip for each
state, showing all the nuclear plants in that state.
I create a data set with the zipcode & web address of each nuclear
plant. I use proc geocode to estimate the lat/long of each zipcode,
to plot the round markers on the map.
I combine the annotate data set with the map, and then gproject them
both together, and then separate them again. By projecting them
together, that guarantees that the annotation will line up in the
exact correct position on the map.
I create another annotate data set with the state abbreviations
(nothing new here - this is done in many examples).
Then I create a map of the entire US, with the internal boundaries
gremoved, and convert that into a gray annotate polygon. I draw
this map before/behind the real map, and offset it a little, and
it looks like a 'shadow' behind the map.
Since I have multiple annotate datasets, I use two anno= -- one in
the proc gmap line, and one as an option in the gmap (this is a little
more convenient than combining all the annotate together into a single
annotate data set).
Back to Samples Index