An overview of color names in R



This post displays more than 100 colors that can be called by a name in R. In case you’re struggling the one that suits you the best.

Color Section About line chart

It is possible to call a color by its name in R. Here is an overview of the main colors offered.

Note that you can see a complete list of the 657 colors typing colors().

See the color section of the gallery for more color calling options.



# No margin around chart
par(mar=c(0,0,0,0))

# Empty chart
plot(0, 0, type = "n", xlim = c(0, 1), ylim = c(0, 1), axes = FALSE, xlab = "", ylab = "")

# Settings
line <- 25
col <- 5

# Add color background
rect(  
  rep((0:(col - 1)/col),line) ,  
  sort(rep((0:(line - 1)/line),col),decreasing=T),   
  rep((1:col/col),line) , 
  sort(rep((1:line/line),col),decreasing=T),  
  border = "white" , 
  col=colors()[seq(1,line*col)])

# Color names
text(  
  rep((0:(col - 1)/col),line)+0.1 ,  
  sort(rep((0:(line - 1)/line),col),decreasing=T)+0.015 , 
  colors()[seq(1,line*col)]  , 
  cex=1)

Related chart types


Ggplot2
Animation
Interactivity
3D
Caveats
Data art



❤️ 10 best R tricks ❤️

👋 After crafting hundreds of R charts over 12 years, I've distilled my top 10 tips and tricks. Receive them via email! One insight per day for the next 10 days! 🔥