12

I am looking for a 5-class qualitative color palette which can be printed in black and white printers.

Below image shows a map in color (top: qualitative, bottom: diverging) and how each looks in grayscale (right hand side). Both color palettes (Set3 and Spectral) belongs to ColorBrewer.

  1. [UL] Qualitative Set3
  2. [UR] Qualitative Set3 in grayscale
  3. [LL] Diverging Spectral
  4. [LR] Diverging Spectral in grayscale

enter image description here

I especially suffer to discern groups in the top-right image, while the bottom (spectral) is much better, if not perfect (i cannot say which was blue or red). And according to ColorBrewer the Spectral color scheme (the one I used here) is the only photocopy safe for 5-class palette.

Reducing classes (to 3 or 4) may be an option, but I am afraid it was not intended purpose of this map.

This is probably not related to GIS softwares, but I basically use QGIS which offers ColorBrewer, cpt-city, and other palettes and color ramps.


@obrl_soil suggested this is Viridis color set

enter image description here


@underdark suggested this is two types of 4 colors + white approach.

enter image description here

LEFT: Orange-Red + white (sequential), RIGHT: Purple-Orange + white (diverging)

  • You already found a good answer but I would like to introduce you to colorbrewer2.org which allows you to generate nice colour schemes – LaughU Jun 4 '17 at 11:58
  • @LaughU It is in fact a website I have been referring to... sorry if it was not clearly mentioned. But thanks, it is really good resource, I do agree. – Kazuhito Jun 4 '17 at 15:09
8

Have you had a look at the viridis family? Easiest way to add them in QGIS is via this link - http://rocksandwater.net/blog/2016/07/qgis_perceptually_uniform_colorramps/

  • 1
    Thanks so much @obrl_soil! This is great. I think I saw the name viridis in R community some time before, but probably I had not paid enough attention. (Added viridis outcome to my post as Edit). – Kazuhito Jun 4 '17 at 11:49
10

As ColorBrewer suggests only the 5 class spectral color scheme is "safe" for photocopier (i.e. grey scale) use. The easiest solution is to use some other way of distinguishing the classes such as hatching.

In QGIS it is a simple matter to choose 5 different hatches in a classification by changing the fill brush.

enter image description here

Or by using a Point Pattern fill with different distances:enter image description here

  • 1
    Thanks @iant, but should I take it (I mean, the ColorBrewer) implies that there is no way producing 5-class color scheme other than that particular set? If so I have no problem going with hatching. – Kazuhito Jun 4 '17 at 11:26
6

Colorbrewer 2.0 basically tells us that there is no "photocopy safe" color scheme with 5 colors, so here is the 4 color solution:

enter image description here

Of course, it does not count "white" as a potential 5th color so this solution might still be sufficient for your application.

  • 1
    Nice. Adding white is brilliant idea never came to mind (I was almost ready to give up ColorBrewer). Thanks! – Kazuhito Jun 4 '17 at 15:05
3
+50

I had the same problem. I needed 8 classes. I created a workaround that allows you to at least make the categories the most distinguishable possible. It increases the distance between the saturation values of each color that are created by the colorbrewer by default. By this you get the most distinguishable categories in b/w print. The two plots change only slightly as you can see below but in bw it can make a difference.

Need to know R to use the script:

library("ggplot2")
library("colorspace")
library("RColorBrewer")


# display all color scales with n=8
display.brewer.all(n = 8,type = "div")
# choose a brewer
brewer.pal(8,"Spectral")
# transform palette to HSV values
(palette.HSV<-as(hex2RGB(brewer.pal(8,"Spectral")), "HSV")) 

# plot
plot(1:8,1:8,pch=21,bg=hex(palette.HSV),col=hex(palette.HSV),cex=5)

# sort and get indices of HSV values
sort(palette.HSV@coords[,2],index.return=TRUE)

# calculate steps for distance
9/8 # 8 classes until 0.9 saturation

# change accordingly
palette.HSV@coords[1,2]<-0.7875 # swapped with second
palette.HSV@coords[2,2]<-0.675
palette.HSV@coords[3,2]<-0.5625
palette.HSV@coords[4,2]<-0.3375
palette.HSV@coords[5,2]<-0.225
palette.HSV@coords[6,2]<-0.1125
palette.HSV@coords[7,2]<-0.45
palette.HSV@coords[8,2]<-0.9

plot(1:8,1:8,pch=21,bg=hex(palette.HSV),col=hex(palette.HSV),cex=5)

# save your costum colorscale
my.scale<-hex(palette.HSV)

changed values changed values

original values enter image description here

edit: if you also want to change the brightness (see discussion below) use the following code:

# change brightness accordingly (reverse order)
palette.HSV@coords[1,3]<- 0.225
palette.HSV@coords[2,3]<-0.4
palette.HSV@coords[3,3]<-0.5625
palette.HSV@coords[4,3]<-0.9
palette.HSV@coords[5,3]<-0.7875
palette.HSV@coords[6,3]<-0.675
palette.HSV@coords[7,3]<-0.3
palette.HSV@coords[8,3]<-0.1125
  • 1
    Thanks @joaoal ! Do you mind adding grayscale representation for each image? My quick trial on your code produced almost identical images (for my untrained eyes) when they turned into 8-bit grayscale. – Kazuhito Jul 5 '17 at 13:53
  • 1
    @Kazuhito not sure how to do that in R. In the bw print my solution is clearly a little bit better than the default, however as I wrote above, it is hard to make really good differences if you use 8 classes. in your case with 5 classes it might be better. Besides improving the color ramp you could also consider adding symbols to your map in the center of each polygon where each unique symbol represents a different category or you could use different fill styles e.g. line patterns. my solution was for raster data where you can not do such thing. – joaoal Jul 5 '17 at 15:34
  • 2
    +1 @joaoal Thanks for your additional info. Just a thought, but how about changing palette.HSV@coords[x,3] which corresponding to Value (or Brightness) in HSV colorspace? (You have been working on Saturation). My quick test on coords[ ,3] produced more contrast but I am not sure in your environment. – Kazuhito Jul 6 '17 at 1:57
  • 2
    @Kazuhito I tried it for my example and did not yield better results i changing the brightness only. In theory the saturation is directly linked to the grayness where 0 is white and 1 is black in bw print /or the full color e.g. "red" in color print. The brightness also affects the grayness in print but somehow your range is limited since it changes the color between full color e.g. "red" and "black". A combination of both might be an option and I added some code above to account for that. I had the impression that only improves the difference in lighter colors, but it worsens the darker ones. – joaoal Jul 6 '17 at 8:51
  • Thanks, good to know. I also do agree that we should not put up too much on Value. – Kazuhito Jul 6 '17 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.