Date: Mon, 9 Oct 2006 09:26:41 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel_Wooding@DOM.COM>
Subject: Re: SAS/Graph -- accessing symbol color from a datastep?
Content-Type: text/plain; charset="US-ASCII"
Here's a possible approach:
1) define your color list in a macro or macro variable -- say
%macro clist; black blue red green %mend clist;
2) use this list in a goptions statement
goptions colors= ( %clist ) ;
Then, when you are setting up your annotate statements, you can scan the
contents of the macro variable and select the appropriate color.
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
SAS/Graph -- accessing symbol color
from a datastep?
Please respond to
Short: Is there a way to get the color for a symbol inside the data
set? E.g. COLOR = SymbolColor(4) would set the variable COLOR to
whichever color was assigned to symbol4. This should work even if it's
only the default color.
Long: I have a dataset of the form:
ClassA ClassB proportion
1-20 unknown levels in [0,1]
I am trying to create a line plot that shows, on the same graph
X-Axis is classA
Y-Axis is proportion
There is a seperate line for each level in classB. So the simple way
PLOT proportion*classA = classB;
The tricky part is that I also want a reference line for each level of
classB showing it's overall proportion (across all values of classA).
This is what I have so far:
(unimport code that calculates the overall proportion for all levels in
classB. For example, annotate before running this datastep might be:
RETAIN HSYS YSYS XSYS '2';
%LINE(1, overallProportion, 20, overallProportion, BLACK, 1,
The problem with this is that you can't tell which reference line goes
to which level, because they are all black! If I had a way to get the
symbol color for symbol "i", I could just replace "BLACK" in the above
example with that color, and the reference lines color would match up
with the plot.
This is trying to be a macro, so I can't code assuming only a certain
number of levels for classB. It should try to be dynamic.
Thanks in advance for any help!
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.