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

---------------------------------------------------------------

Xan Gregg (representing SAS) recently won Stephen Few's 2006
business graphics contest.

Click here to see Xan's actual graph.

This example is my own (Robert Allison) implementation, using traditional
SAS/Graph, to produce a graph (almost) exactly like Xan's winning graph.

I used "proc import" to read the csv data.

I used SAS/Graph "proc gcontour" to produce the underlying contour
plot with the shades of purple.  Since there is no easy way to 
overlay a "proc gplot" line chart with gcontour (guaranteeing that
everything lines up with the axes exactly the same), I used "annotate"
to draw the lines (this guarantees they are drawn in the exact
same coordinate system as the contour plot).

I had to get a little "tricky" to get the graph to look exactly like
Xan's graph...

To get the month names to center in the middle of the month ranges
along the x-axis (rather than at the tickmarks), I annotated them
(alternatively, I might could have used justify=right or left,
but annotate gives me more control & flexibility).

I also annotated the year label at the beginning of each line.

To get the legend in this specific location, I was not able to 
use position=(top right) because that puts the legend to the 
right of the graph - therefore I used position=(top) and then
bumped it over to the right somewhat using the "offset" 
in the legend statement.

The 'title' info to the left of the legend was also annotated.
The colored box behind the current level & status was annotated
using the 'bar' function - it is color-coded to represent the 
most recent data value.

Back to Samples Index