BookmarkSubscribeRSS Feed
Not applicable
For, the code of this sample is not complete. I am very interested in the pattern setting part. Actually I would like to know the color setting for this graph. Thanks.

And is there any page in support site, specially to explain all colors in SAS?I find one page If know the RGB, how to specify the related SAS Color? Thank You.....

That code is complete. The colors are set based on the version of SAS that you're using, the destination that you're using and the current color list that's being used and the current set of PATTERN statements in effect. If you did not see the colors as shown on the Results Tab, it's probably because those are the colors that you would get by default in SAS 9.2 and you might be using SAS 9.1.3 or, if you are using SAS 9.2, perhaps you had a different STYLE template in effect when the program was run.

For example, if you are using SAS 9.1.3 and the default Windows device and displaying your graphs in the GRAPH1 window, then the default colors come from the WIN device driver.

On the other hand, if you are using SAS 9.2 and the default Windows device and displaying your graphs in the GRAPH1 window, then the default colors come from the current style template (probably the LISTING style) that's being used for the ODS LISTING destination.

Your choices to change the current colors and/or patterns being used for your output are:
1) Change the colors using the COLORS option in the GOPTIONS statement
2) Change the colors and patterns for filled areas in PROC GCHART output by using a PATTERN statement
3) Use internal procedure options or other GOPTIONS (like CBACK, CPATTERN, etc) to change colors
4) Change the colors in the style template in SAS 9.2

Information about the COLORS graphics option:

Information about specifying colors using different color schemes (such as RGB or HLS, etc):

Information about the PATTERN statement:

Information about SAS macros for "utility" purposes regarding colors:

The color chart to which you referred only shows 256 colors and gives their names in various color systems when you hover your mouse over a square on the chart. This is not the only way to figure out color names. You could, in fact, use any HTML color picker to come up with RGB colors for SAS/GRAPH programs, because the HTML colors for RGB can also be used in SAS/GRAPH programs, as explained in the documentation site above.

The way you "read" the RGB colors is like this:
where the prefix CX tells SAS that you want to use RGB colors
and rr is the hexadecimal number for red value
and gg is the hexadecimal number for green value
and bb is the hexadecimal number for blue value

Here is a Tech Support note and some user group papers that explicitly talk about color theory and RGB colors:

Not applicable
Thank you so much, so detailed and very clear...




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
  • 2 in conversation