BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pmusale
Calcite | Level 5

Hello

I am new to SAS and am in the learning phase. I encountered a code, part of it is pasted below:

ods html;

goptions reset = all border

     ctext = CX000000 ftext = "MS Sans Serif" htext = 8pt

     colors = (color1     color2     color3     color4

                   color5     color6     color7     color8

                   color9     color10    color11   color12);

axis1 minor = none label = ("random");

axis2 minor = none label = ("pdf_x");

              order = (0 to 0.4 by 0.02);

symbol1 line =1 ci=CX0000FF     cv=CX0000FF     value = dot     width =1      height = 6 pt

interpol = needle;


color1 to color12 are in code formats, for simplicity I have written color1-12 here


I checked help for various statements here. I have following question:


  1. colors statement has 12 colors specified in it. What I understand is that we define colors using this statement. However I am not able to understand how do we use these colors? I mean where would be color1 used, wherer would be color2 used and so on. Do we have to specify these colors again somewhere in the code?
1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

That's sort of the "old school" way to specify colors in SAS/Graph.  You give it a list of colors, and then the colors are consumed "as needed".  There are very few cases where you would need to use a goptions colors=() list these days.  I think of these color lists as being analogous to the pens in a pen-plotter.

In more modern SAS/Graph, you can specify colors more directly (using symbol statements for gplot, and pattern statements for gchart, etc).

View solution in original post

2 REPLIES 2
GraphGuy
Meteorite | Level 14

That's sort of the "old school" way to specify colors in SAS/Graph.  You give it a list of colors, and then the colors are consumed "as needed".  There are very few cases where you would need to use a goptions colors=() list these days.  I think of these color lists as being analogous to the pens in a pen-plotter.

In more modern SAS/Graph, you can specify colors more directly (using symbol statements for gplot, and pattern statements for gchart, etc).

pmusale
Calcite | Level 5

Thanks RobertAllison@SAS

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 665 views
  • 0 likes
  • 2 in conversation