Data visualization with SAS programming

gplot bar chart selecting colors

Reply
N/A
Posts: 0

gplot bar chart selecting colors

I'm looking for a set of colors that can be distinguished when printed in black and white. The colors must be solid because I've tried various patterns and they were not received well.

I'm creating stacked bar charts represent ranked order responses to a survey. There are 6 possible responses to each question. As a result I want to keep the colors in some kind of order similar to the color spectrum but when printed in black and white they run from white to black (or nearly black).

The problem I'm having is for the most part the colors can be distinguished but there are always a couple that become too close when printed in black and white.

I'm currently using

pattern1 color=white v=s;
pattern2 color=lightorange v=s;
pattern3 color=orange v=s;
pattern4 color=red v=s;
pattern5 color=darkgreen v=s;
pattern6 color=darkblue v=s;

However, pattern2 and pattern3 appear a bit close in black and white to be easily distinguishable. I've tried several other patterns but that just shifts the problem to a different pair of neighboring sections
Super Contributor
Super Contributor
Posts: 3,174

Re: gplot bar chart selecting colors

Suggest looking here:

TS-688
Defining Colors using Hex Values
With the Gray-Scale and RGB Color Naming Schemes
http://support.sas.com/techsup/technote/ts688/ts688.html

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic/post:

colors -jmp site:sas.com

..or..

colors technote site:sas.com
N/A
Posts: 0

Re: gplot bar chart selecting colors

the problem is not the colors

the problem is how they print in black and white. I'm trying to produce one copy that can be printed in either color and black and white to reduce the difficulty in distinguishing the adjacent sections
N/A
Posts: 0

Re: gplot bar chart selecting colors

A big problem in the chart occurs when a section is missing and you print it out in black and white. It becomes difficult to tell what subgroup your looking at so for example if pattern1 and pattern2 is missing in a bar figuring out that your looking at pattern3 and not pattern2 is a challenge. I've tried to fix this problem by providing a table but they still want the color/gray scale problem fixed.
Super Contributor
Posts: 291

Re: gplot bar chart selecting colors

Bill;

go to www.colorbrewer.org. The only set of 4 colours that I've found that works for colour, black & white, projector viewing and colour deficient people is the 4--class sequential OrRd. If you only need three, there's a lot more choice. If you are using stacked bars, I would not use more than 3. If there are more than 3 categories, find another way to tell the story. Readability suffers when there's more than 3 levels.
SAS Employee
Posts: 3

Re: gplot bar chart selecting colors

Would using values of gray help?

pattern1 c=grayaa ;
pattern2 c=graycc ;
pattern3 c=grayee ;
pattern4 c=gray11 ;
pattern5 c=gray33;
pattern6 c=gray55;
Super Contributor
Posts: 291

Re: gplot bar chart selecting colors

Again, per colorbrewer, more than 3 shades of gray is likely to be a problem.
A re-design of the graph might be a better choice from a data visualization point of view.
How about stacking 6 very small vbar graphs into one template? Possible code for all but the template below - all with one colour!

data test;
input q r1 r2 r3 r4 r5 r6;
cards;
1 10 15 8 25 35 7
2 8 25 1 40 18 8
3 10 12 0 55 12 11
4 5 15 8 25 35 12
5 8 27 3 36 18 8
6 10 12 0 50 17 11
;
run;

proc transpose data=test out=test2;
by q; var r1-r6; run;

goptions reset=all dev=win noborder ftext='helvetica' hsize=3in vsize=1.2in;

axis1 label=none value=none;
axis2 label=none;
axis3 order=(0 to 60 by 20) minor=none label=none;
pattern1 v=s c=cxfc8d59;

proc gchart data=test2;
by q;
where q < 6;
Super Contributor
Posts: 291

Re: gplot bar chart selecting colors

and the last part ..

vbar _name_/sumvar=col1 maxis=axis1
raxis=axis3 discrete noframe coutline=same;
run;
where q = 6;
vbar _name_/sumvar=col1 maxis=axis2
raxis=axis3 discrete noframe coutline=same;
run;
quit;
Post a Question
Discussion Stats
  • 7 replies
  • 181 views
  • 0 likes
  • 4 in conversation