BookmarkSubscribeRSS Feed
deleted_user
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
7 REPLIES 7
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
deleted_user
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
deleted_user
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.
Bill
Quartz | Level 8
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.
dbravo
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;
Bill
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;
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;
Bill
Quartz | Level 8
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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1068 views
  • 0 likes
  • 4 in conversation