01-23-2012 02:07 PM
Is there a way to assign specific colors to values in a 2 or 3 d chart? I have counts by month by year. Years tend to vary within a modest range. I'd like to make the same year the same color across any given graph.
It seems like this would be a parameter within an Axis statement, but I didn't see anything obvious.
01-23-2012 03:53 PM
For 9.1.3, your choices will definitely be more limited. For 3-D scatterplots, you can use PROC G3D and the SCATTER statement. On this statement, there are three visual options that take either literal values or variables: COLOR, SHAPE, and SIZE. You can use a datastep to encode these attributes into different columns based on a criteria in your datastep. Then, assign those variables using those SCATTER options. Other than this procedure, I do not know of another reliable way of making attribute assignments at 9.1.3
In 9.2, the Graph Template Language (GTL) has a plot option called INDEX which takes a variable that is an index to an ODS style element. This index variable is usually created using criteria in a datastep, similar to the previous idea. This option is available on most plot statements that support GROUP variables.
In 9.3, both GTL and the SG procedures have true attribute map capabilities. These attributes maps give the ability to assign visual attributes (fill/line/marker colors, line patterns and marker shapes) to data values, and these attributes are applied to the data values regardless of data order. The input data does not have to be processed in a datastep as in the the previous two examples. GTL also the ability to create attribute maps for continuous ranges. If you have not upgraded yet, version 9.3 is probably the best version to accomplish what you want.
Hope this helps!