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

Hi,

 

Is there somewhere on the SAS website where it states the order that colors are used in SAS graph, when no color is used within the graph.

 

I just need to know the order SAS graph (I am using PROC SGPLOT) cycles through the colors available.

 

Thanks,

 

Mani

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Most ODS styles will have objects GRAPHDATA1 though GRAPHDATAn, n might vary from style to style but 12 seems to be the default for most of the SAS supplied styles. These contain colors for fill, outline, lines, marker types and such. So the first "color" needed by your graph will get values from GRAPHDATA1, the second from  GRAPHDATA2, and so on. When the colors get exhausted if more are needed then other rules may come into play such as cycling patterns and line types.

 

Some of the styles, such as JOURNAL and it's derivatives are intended for mostly black and white or gray scale output so rely more on patterns than color.

 

Proc template, as shown in the link @PeterClemmensen provided as an example, can get the definitions from a style though may rely on inheritance from a parent style.

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Hi and welcome to the SAS Communities 🙂

 

I think you will find this post very informative

 

https://blogs.sas.com/content/iml/2017/02/06/group-colors-sgplot.html

Mani2
Calcite | Level 5

Excellent - exactly what I need.

ballardw
Super User

Most ODS styles will have objects GRAPHDATA1 though GRAPHDATAn, n might vary from style to style but 12 seems to be the default for most of the SAS supplied styles. These contain colors for fill, outline, lines, marker types and such. So the first "color" needed by your graph will get values from GRAPHDATA1, the second from  GRAPHDATA2, and so on. When the colors get exhausted if more are needed then other rules may come into play such as cycling patterns and line types.

 

Some of the styles, such as JOURNAL and it's derivatives are intended for mostly black and white or gray scale output so rely more on patterns than color.

 

Proc template, as shown in the link @PeterClemmensen provided as an example, can get the definitions from a style though may rely on inheritance from a parent style.

Mani2
Calcite | Level 5

Thank you for the information, both responses have exactly what I need.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 875 views
  • 6 likes
  • 3 in conversation