Blind color figures

15 views
Skip to first unread message

laiaju...@gmail.com

unread,
May 28, 2025, 1:08:24 PMMay 28
to dartR
  Hi everyone, I'm about to start the publication process and wanted to ask if anyone might be able to help me with a code that is color-blind friendly but also allows me to keep the same regions in the same color across all figures. 
Thanks in advance!  
Laia

Jose Luis Mijangos

unread,
May 28, 2025, 9:22:11 PMMay 28
to dartR

Hi Laia,

 

Yes, it’s super important to stick with the same colours for each population across all the plots so the reader doesn’t get confused.

 

Here are a few colour-blind friendly options you might find handy:

 

library(dartRverse)

t1 <- bandicoot.gl

pcoa <- gl.pcoa(t1)

 

# Option 1: Adobe Color Wheel (great, but limited to 5 colours)

https://color.adobe.com/create/color-accessibility

# Just click the middle of a colour to get the code

pop_colors <- c("#0A09EB", "#EAE5A6", "#42CAEA", "#DAEB09", "#6B3896")

gl.pcoa.plot(pcoa, x = t1, pt.colors = pop_colors)

 

# Option 2: Okabe-Ito palette (one of the best for accessibility!)

# Info: https://siegal.bio.nyu.edu/color-palette/

library(pals)

pop_colors <- okabe(n = nPop(t1))

gl.pcoa.plot(pcoa, x = t1, pt.colors = pop_colors)

 

# Option 3: RColorBrewer palettes

library(RColorBrewer)

display.brewer.all(colorblindFriendly = TRUE)

pop_colors <- brewer.pal(n = nPop(t1), name = "Dark2")

gl.pcoa.plot(pcoa, x = t1, pt.colors = pop_colors)

 

Cheers,

Luis

Laia Juliana Muñoz

unread,
May 29, 2025, 7:48:58 AMMay 29
to da...@googlegroups.com
Thank you so much Jose Luis 

--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartr+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/dd89baf9-a10d-4406-b4eb-fe2cd5bd45b6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages