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

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

SAS/Graph imitation of:
http://phicouncil.org/w/PrisonPopulation/media/prisonpop2009v1.png

Using data from:
http://phicouncil.org/w/PrisonPopulation/media/prisonpop2009v1.xls


The thing you'll notice most about this graph is the black background
(goptions cback=black), and the white text (goptions ctext=white),
and also the image inside the axes (iframe=).

One neat 'trick' I uses, is that I created a user-defined format
(data driven) so that the items in the legend print as both the
country name, and the 2008 rank (... while keeping the legend
in the numeric order of the rank).

Aside from that, I'm using the fairly new "colmajor" legend option 
to order the legend by columns, rather than across (rows), and the
"pointlabel" option to add text for the markers on the U.S. line.
Also, the "repeat=1" option on the legend statement to force 1 
marker to be shown in each legend entry (rathere than 3).

The line looks a little better with the anti-aliasing available 
in v9.3 (looked more jagged in v9.2), and the image looks *much* 
better with png supporting 16 million colors in v9.2 (sas only
handled 256 colors in v9.1.3).

There's a little bit of "tricky stuff" going on with the data.
I import it from an Excel spreadsheet, and transpose it with
proc transpose. 

Back to Samples Index