I would quickly look up at two particular co-workers. We all had that same rolling of the eyes look. When you have color-challenged issues, that red line does not clearly demonstrate anything to us. (And yes, the three of us knew we all had color issues.)
I wrote the R code for this graph. But I used a random number to decide which line is red and which is green, so I don't know which line is which.
I am not color-blind. I am color-challenged. I see some colors, but probably not as many as most people see. I don't distinguish between red and green well. I also don't distinguish between blue and purple well because of the red element of purple, and similarly for other combinations.
In my earliest elementary school years I had a box of 8 Crayola crayons, and I did just fine. My problems began when Crayola started adding more and more colors including combinations like green yellow and yellow green. Here are the original eight colors, which I still identify just fine. (There is no meaning to the heights of the bars.)
One source suggests approximately 1 in 12 men have color issues, but only 1 in 200 women.
Color-challenged people often have coping strategies. I can see when the top traffic light is on, so I will stop my car. But in my heart, I don't think it is red, but more of an orange. Similarly I can see when the bottom traffic light is on, but I think it is more of an off-white than green. As long as no one flips the positions, I am fine. A single flashing light is a probllem though.
When I see an 8-sided stop sign, that's what I consider red. And I recognize Taylor Swift wears what I consider a very red lipstick, but I assume she wears more than one shade and I cannot distinguish among them.
The speaker with the two-line graph could have used the different shapes, or different graph line types dashes and dots, in the talk. Or the speaker could have used color-blind friendly color palettes. If you are creating visualizations for others, please think about these things.
And ladies, that purple lipstick looks very nice on you. Oh, it's not purple ... ?
The R code is as follows:
# Two lines with random colors
x <- seq(1:5)
y <- seq(1:5)
z <- seq(5,1, by = -1)
color_1 <- "#00B050"
color_2 <- "#FF0000"
r <- runif(1,0,1)
r
if (r < .5){
col_y <- color_1
col_z <- color_2
} else{
col_y <- color_2
col_z <- color_1
}
plot(x,y, type="b", pch = 18, cex = 2.5, lwd = 2.5, col=col_y, ylab="", xlab="",
main="As the red line clearly demonstrates ...", cex.main = 1.5,
sub="If r<.5 then (green, red), else (red, green)",
font.sub = 2, cex.sub = 1.5)
par(new=TRUE)
plot(x,z, type="b", pch=20, cex = 2.5, lwd = 2.5, col=col_z, ylab="", xlab="")
legend("topright", legend= c("Increasing", "Decreasing"), pch = c(18, 20),
col = c(col_y, col_z), cex=1.5, text.font=2)
# Original 8 Crayola Crayons
title <- c("Original 8 Crayola Crayons")
subtitle <- c("According to https://en.wikipedia.org/wiki/History_of_Crayola_crayons")
temp <- c(5,7,6,4,8,5,2,5) # meaningless
colors <- c("red", "yellow", "blue", "green", "orange", "brown", "violet", "black")
hex <- c("#FF0000", "#FFFF00", "#0000FF", "#008001", "#FF6600", "#964B00", "#6A0DAD", "#000000")
barplot(temp, col=hex, main=title, sub=subtitle, names.arg=colors,
cex.main = 1.5, font.axis = 2, font.sub = 2, cex.sub = .75 )
End



Could you elaborate on the "color-blind friendly color palettes" and more generally what your recommendations are? The 8 colors that you identify just fine include red and green, but earlier you say that you can't distinguish between red and green. Is there any way to rely purely on colors in graphs that would not cause issues for anyone?
ReplyDeleteThere are several types of colorblindness, and a friendly palette is one where the colors are distinguishable for all three types. One colorblind friendly color palette I like is Okabe-Ito. okabe_palette <- palette.colors(n = 8, palette = "Okabe-Ito") I can see all eight nicely, although I can't name all of them. In the graph with the two lines, I deliberately chose a shade of green #00B050 that I know I cannot distinguish from red; this is different than #008001 in the 8 colors. But using different shapes, line types, or labels would be best.
ReplyDelete