Data visualization with SAS programming

Changing Graph Colors in a Predefined Style

Accepted Solution Solved
Reply
Regular Contributor
Posts: 215
Accepted Solution

Changing Graph Colors in a Predefined Style

I am not very good with PROC TEMPLATE.  I have a general idea of what I need to do, but I can't seem to get my changes to take hold, so I'm reaching out to the SAS gurus.

 

I usually use the LISTING style when producing graphs in RTF format through ODS.  When I use a GROUP= option, the style defaults to making the first category blue, the second red, and the third green.  I would like to swap the red and green.

 

I know there is a GraphColors class, but there are so many options in there that I'm not sure what I'm supposed to be chainging.  I don't know the difference between GDATA, GCDATA, GNDATA, GNCDATA, etc.  Can someone show me a snippet of code that can swap (or even change) colors in a predefined style template?  And maybe as an added bonus, explain the difference between all the GDATA options?


Accepted Solutions
Solution
‎06-08-2016 04:01 PM
SAS Super FREQ
Posts: 3,236

Re: Changing Graph Colors in a Predefined Style

[ Edited ]

Sure. Look at the examples by Dan Heath about "attribute maps". You can use the DATTRMAP= option in PROC SGPLOT to specify attributes, Or you can use the DISCRETEATTRMAP statement in the GTL.

 

Here are some other options, if you want to use SGPLOT:

1. Specify the colors of groups in SAS statistical graphics

2.Set attributes of markers in PROC SGPLOT by using ODS style elements. This article explains the various style elements and links to important sections of the documentation.

 

 

 

View solution in original post


All Replies
Solution
‎06-08-2016 04:01 PM
SAS Super FREQ
Posts: 3,236

Re: Changing Graph Colors in a Predefined Style

[ Edited ]

Sure. Look at the examples by Dan Heath about "attribute maps". You can use the DATTRMAP= option in PROC SGPLOT to specify attributes, Or you can use the DISCRETEATTRMAP statement in the GTL.

 

Here are some other options, if you want to use SGPLOT:

1. Specify the colors of groups in SAS statistical graphics

2.Set attributes of markers in PROC SGPLOT by using ODS style elements. This article explains the various style elements and links to important sections of the documentation.

 

 

 

Post a Question
Discussion Stats
  • 1 reply
  • 129 views
  • 0 likes
  • 2 in conversation