Data visualization with SAS programming

Change default color in Graphs from black to dark gray?

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Change default color in Graphs from black to dark gray?

I have a lot of codes with graphs. Is there a way to change the default color (text, lines, borders) from black to dark gray? In this way, I would not need to change all of my existing codes.

Hope you guys could help me figure this out.


Accepted Solutions
Solution
‎04-11-2014 08:13 AM
SAS Employee
Posts: 982

Re: Change default color in Graphs from black to dark gray?

Assuming you're using a recent/modern version of SAS (such as 9.2 or higher), as people have said the colors are controlled by the ODS Graph Styles by default.

And *if* you happen to be using traditional sas/graph procs (such as gplot, gchart, gmap, gslide) you can turn off the ods graph styles (using the 'nogstyle' option), and then control the default colors using a goptions colors list - the following shows how to turn everything in the gplot green (or you could use a gray such as gray55 or cx555555, or any other color):

goptions reset=all;

options nogstyle;

goptions colors=(green);

proc gplot data=sashelp.class;

plot height*weight;

run;

foo.png

View solution in original post


All Replies
Super User
Super User
Posts: 7,970

Re: Change default color in Graphs from black to dark gray?

Hi,

All output, be it tables, graphs etc. colors, fonts, sizes etc. are controlled by templates.  Identify if you have  a style statement somewhere then modify that style, or create your own style using proc template.  Basic introduction to templates/style:

http://www2.sas.com/proceedings/sugi31/112-31.pdf

New Contributor
Posts: 2

Re: Change default color in Graphs from black to dark gray?

Hi. Yes, this is actually my alternative plan. However, I would just like to know if it's possible to change the default instead. Thanks for your suggestion! Smiley Happy

Super User
Super User
Posts: 7,970

Re: Change default color in Graphs from black to dark gray?

Well, the defaults themselves are held in templates also.  So in styles there is one called "Default".  This is used in the absence of any provided.  So if you wanted to change the default, then you would need to inherit this (or printer) and change the color etc. to your needs.

Solution
‎04-11-2014 08:13 AM
SAS Employee
Posts: 982

Re: Change default color in Graphs from black to dark gray?

Assuming you're using a recent/modern version of SAS (such as 9.2 or higher), as people have said the colors are controlled by the ODS Graph Styles by default.

And *if* you happen to be using traditional sas/graph procs (such as gplot, gchart, gmap, gslide) you can turn off the ods graph styles (using the 'nogstyle' option), and then control the default colors using a goptions colors list - the following shows how to turn everything in the gplot green (or you could use a gray such as gray55 or cx555555, or any other color):

goptions reset=all;

options nogstyle;

goptions colors=(green);

proc gplot data=sashelp.class;

plot height*weight;

run;

foo.png

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 528 views
  • 9 likes
  • 3 in conversation