LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 17 Dec 2003 15:32:21 -0500
Reply-To:   Evan Cooch <evan.cooch@NOSPAMCORNELL.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Evan Cooch <evan.cooch@NOSPAMCORNELL.EDU>
Organization:   Cornell University
Subject:   PROC GMAP | specifying colors | choro
Content-Type:   text/plain; charset=us-ascii

Greetings -

Having trouble figuring out how to achieve some control over what colors are assigned to which levels in a choropleth map using PROC GMAP in SAS 8.xx.

Here's the situation. I rank individual states (using a US map) according to some variable. There are 4 possible levels of the state ranking (call them A, B, C, and D). I do this ranking in each of (say) 5 years. In some years, all of the different ranks are represented (i.e., there is at least one state in each of the 4 ranks). However, in other years, not all ranks are represented.

What I want to do is have the same color used for a given rank, relgardless of what ranks are in the data set for a given year. At the moment, SAS/GRAPH is making this hard to do (translation - I haven't figured out how to do it).

I've tried the following: setting PATTERN to be a specific color:

eg..,

PATTERN1 COLOR=RED; PATTERN2 COLOR=BLUE; PATTERN3 COLOR=BLACK; PATTERN4 COLOR=GREEN;

What I want is for rank 1 = red, rank 2 = blue, rank 3 = black, and rank 4 = green.

Now, if I plot the map for a given year that has all for ranks in the data set, then it works fine. However, suppose in a given year I have only 3 ranks (say, rank 2, rank 3 and rank 4). The map should in theory have only BLUE, BLAKC and GREEN states. However, what SAS/GRAPH does is ALWAYS make the first level of the ranks encountered RED, the second level blue, and so on. So,, instead of getting BLUE (for rank 2), BLACK (for rank 3) and GREEN (for rank 4), I get RED (for rank 2), BLUE (for rank 3), and BLACK (for rank 4).

Can anyone suggest a way around this? I realize I could simply recode the PATTERNx states, running each year 1at a time, but that is extremely cumbersome. I have 50 years, and would rather be able to run the program once, and correctly have SAS/GRAPH permanently associate a pattern color with a given rank.

Thanks in advance...


Back to: Top of message | Previous page | Main SAS-L page