Skip to content

  • Home
  • Life Coach
  • Travel Lifestyle
  • Luxury Lifestyle
  • Travel Tips
  • Urban Life
  • More
    • Contact Us
    • Disclaimer
    • Terms and Conditions
    • About Us
    • Privacy Policy
  • Tech
  • Toggle search form
End the rainbow! Oh, wait.

End the rainbow! Oh, wait.

Posted on July 30, 2025 By rehan.rafique No Comments on End the rainbow! Oh, wait.

It’s been a while now since there is a growing understanding that rainbow color
palettes can negatively impact how accurately we perceive and interpret data visualizations.
Rainbow maps have been linked to lower accuracy and are not readable by color-blind readers. This gave rise to the
#EndTheRainbow movement among many scientists across various fields.

Some people might not know this, but a team at Google has come to rescue the
rainbow lovers. A couple of years ago, they created
Turbo, An Improved Rainbow Colormap for Visualization. It seems turbo is distinguishable and smooth for all types of color blindness conditions, except Achromatopsia (total color blindness).

The turbo color palette is now available in R with the viridisLite
package. Here is a quick demonstration:

library(viridisLite)
library(ggplot2)
library(patchwork)
library(dplyr)
library(reshape2)

plot_list <- lapply(X=c('viridis', 'inferno', 'cividis', 'turbo'), 
                   FUN=function(i){
                                   volcano %>% 
                                     melt() %>%
                                     ggplot() +
                                     geom_tile(aes(x = Var1, y = Var2, fill = value)) +
                                     scale_fill_viridis_c(option = i) +
                                     labs(subtitle = paste0(i), fill="") +
                                     #coord_fixed() +
                                     theme_void()
                                     }
                                  )
# patch plots together
plot_list[[1]] +
plot_list[[2]] +
plot_list[[3]] +
plot_list[[4]]

ggsave(filename="turbo_test.png", dpi=200, 
       width = 16, heigh=10, units="cm")

End the rainbow! Oh, wait.

Before we get too excited, even the turbo rainbow palette exaggerates the colors a bit. See below. If your data visualization involves really smooth and detailed transitions, you should probably stick to the #EndTheRainbow movement.

library(imager)

my_photo <- load.image('https://www.urbandemographics.org/img/post_images/urban_picture_rio_lucasmagno.jpg')

# color palettes
p_viridis <- scales::gradient_n_pal(viridisLite::viridis(n=1000))
p_inferno <- scales::gradient_n_pal(viridisLite::inferno(n=1000))
p_turbo <- scales::gradient_n_pal(viridisLite::turbo(n=1000))

# plot
png("turbo_test_rio.png", units="cm", width=14, height=17, res=200)
# insert ggplot code

par(mfrow=c(2,2), mai = c(.05, 0.05, .05, 0.05))

plot(my_photo, axes=FALSE)
grayscale(my_photo) %>% plot(colourscale=p_viridis,rescale=FALSE, axes=FALSE)
grayscale(my_photo) %>% plot(colourscale=p_inferno,rescale=FALSE, axes=FALSE)
grayscale(my_photo) %>% plot(colourscale=p_turbo,rescale=FALSE, axes=FALSE)

dev.off()


Urban Life

Post navigation

Previous Post: Million-Dollar Classic Car Masterpieces
Next Post: How You Can Stomp Grapes in the Douro Valley in Portugal

More Related Articles

Is the 3rd Annual Great Georgia Pollinator Census on Your Calendar? – Center for Urban Agriculture Is the 3rd Annual Great Georgia Pollinator Census on Your Calendar? – Center for Urban Agriculture Urban Life
Creating a figure of map layers in R Creating a figure of map layers in R Urban Life
66 Square Feet (Plus): Yuzu syrup, sort of 66 Square Feet (Plus): Yuzu syrup, sort of Urban Life
Farming in 4D: Opening to New Dimensions of Time Farming in 4D: Opening to New Dimensions of Time Urban Life
A Guide to Successful Growth in the PNW A Guide to Successful Growth in the PNW Urban Life
Entwining BART and Caltrain Elegantly in San Francisco Entwining BART and Caltrain Elegantly in San Francisco Urban Life

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Where to have Christmas in July — the Oriana Motel, OrangeMr and Mrs Romance
  • Naina.co Luxury, Travel, Fashion & Lifestyle Photographer in Adelaide Mount Lofty Botanic Garden
  • Isle of Skye Honesty Boxes + Where to Find Them
  • Traveling Through Spain? Stay Online Without a Local SIM Using eSIM
  • Casino uden NemID | Bedste online casinoer uden NemID

Categories

  • Life Coach
  • Luxury Lifestyle
  • Travel Lifestyle
  • Travel Tips
  • Urban Life

Copyright © 2025 .

Powered by PressBook Blog WordPress theme