R色盲可访问的色图组合 [英] R Plot Color Combinations that Are Colorblind Accessible
问题描述
我如何在 base R 中选择4-8种颜色,以使色盲人员能够看到这些图?
下面是基本R色托盘。在不使用软件包的情况下在 BASE R 中寻找解决方案。
Base R调色板指南:
要在问题图中列出的基础中创建自定义调色板:
customvermillion <-rgb(213 / 255,94 / 255,0 / 255)
custombluegreen <-rgb(0 / 255,158 / 255,115 / 255)
customblue< -rgb(0 / 255,114 / 255,178 / 255)
customblueblue< -rgb(86 / 255,180 / 255,233 / 255)
customreddishpurple< -rgb(204 / 255,121 / 255,167 / 255)
然后在
plot()
代替使用参数:
plot(mtcars $ mpg,mtcars $ hp,col = c( orange, skyblue))
使用参数:
图(mtcars $ mpg,mtcars $ hp,col = c(customorange,c ustomskyblue))
How do I choose 4-8 colors in base R for plots that colorblind people will be able to see?
Below is the base R color pallet. Looking for a solution in BASE R without the use of packages.
Base R Color Palette Guide: http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
Color Palettes for Color Blindness: http://mkweb.bcgsc.ca/colorblind/
Specifically how do I manually create accessible colors in BASE R?
e.g. "vermilion", "bluish green", and "reddish purple" as described in the paper figure below.
To create a custom color palette in base as listed in the question figure:
customvermillion<-rgb(213/255,94/255,0/255)
custombluegreen<-rgb(0/255,158/255,115/255)
customblue<-rgb(0/255,114/255,178/255)
customskyblue<-rgb(86/255,180/255,233/255)
customreddishpurple<-rgb(204/255,121/255,167/255)
Then when referencing in
plot()
Instead of using parameter:
plot(mtcars$mpg,mtcars$hp,col=c("orange","skyblue"))
Use parameter:
plot(mtcars$mpg,mtcars$hp,col=c(customorange,customskyblue))
这篇关于R色盲可访问的色图组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!