BookmarkSubscribeRSS Feed
Not applicable
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
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest looking here:

Defining Colors using Hex Values
With the Gray-Scale and RGB Color Naming Schemes

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic/post:

colors -jmp


colors technote
Not applicable
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
Not applicable
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.
Quartz | Level 8

go to 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
Would using values of gray help?

pattern1 c=grayaa ;
pattern2 c=graycc ;
pattern3 c=grayee ;
pattern4 c=gray11 ;
pattern5 c=gray33;
pattern6 c=gray55;
Quartz | Level 8
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;
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

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;
Quartz | Level 8
and the last part ..

vbar _name_/sumvar=col1 maxis=axis1
raxis=axis3 discrete noframe coutline=same;
where q = 6;
vbar _name_/sumvar=col1 maxis=axis2
raxis=axis3 discrete noframe coutline=same;



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
  • 7 replies
  • 4 in conversation