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

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

Note that this example is included in the book SAS/Graph: Beyond the Basics,
and all the 'tricks' used to create it are described in great detail!

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

The original (non-sas) version of this chart looks very simple...
http://biomed.brown.edu/Courses/BI108/BI108_2005_Groups/02/mortality.htm

(Note that I did not have the actual data values - I had to read
the original chart, and *estimate* my data ... therefore, my chart
is close, but not exact!)

But, there are a lot of little effects that I had to jump through 
some tricky hoops to do in sas :)

To show the 'broken' axis in sas, I used some 'offset' space at the
bottom of the vaxis, and then I annotated some '/'s (rotated to the 
appropriate angle) for the 2 break-marks.

To get the double-line effect, I plotted the same data 3 times.
Once with a very thick black line, once with a medium-thick red 
or white line, and then a final time with the round empty marker 
at the vertices (I added these round markers so the user would 
know exactly where the data values were, versus where the interpolated
line was - also, they now know where to mouse-over for the charttip).  

Since I actually have 6 line symbols, the automatic legend would have
shown all 6.  Since I only wanted the 2 colors in the legend, I faked
a legend manually.  I used the footnote statement to do this.  The boxes,
are created using the 'U' character of the marker sas/graph software font.
I then used the markere (empty marker) font to draw the black outline
around each box (I had to use the 'move' command to backspace and draw
the empty box outline exactly over the colored box).

To get the axis labeled exactly like the original plot (4-digit year on the
first tickmark, then 2-digit year on every other tickmark, and the last 
tickmark blank), I had to just totally hard-code all the axis tickmark 
values.  I would normally not do this (because if the data changes, this
hardcoded axis could then be wrong), but this was the only way I knew to
get the axis to look exactly like the original.

Back to Samples Index