R语言配色方案-colortools
欢迎来到医科研,这里是白介素2的读书笔记,跟我一起聊临床与科研的故事, 生物医学数据挖掘,R语言,TCGA、GEO数据挖掘。
如何在R中选择好看的配色-第一期
颜色是优雅的可视化中重要的元素,介绍如何创建好看的颜色板
colortools包是由Gaston Sanchez创建的一个简单易用的色板创建包
1if(!require(colortools)) install.packages("colortools")
2library(colortools)
wheel函数创建一个色盘
提供颜色选择,给出了相应的颜色代码
1wheel("darkblue", num = 12)
2## [1] "#00008B" "#46008B" "#8B008B" "#8B0046" "#8B0000" "#8B4500" "#8B8B00"
3## [8] "#468B00" "#008B00" "#008B45" "#008B8B" "#00468B"
相似的颜色选取
1analogous("darkblue")
2## [1] "#00008B" "#46008B" "#00468B"
对比的配色方案
1complementary("steelblue")
2## [1] "#4682B4" "#B47846"
拆分配色方案
1splitComp("steelblue")
2## [1] "#4682B4" "#B4464B" "#B4AF46"
Tetradic Color Scheme
1tetradic("steelblue")
2## [1] "#4682B4" "#7846B4" "#B47846" "#82B446"
1square("steelblue")
2## [1] "#4682B4" "#AF46B4" "#B47846" "#4BB446"
1sequential("steelblue")
2 [1] "#B4B4B4FF" "#ABB0B4FF" "#A2ACB4FF" "#99A8B4FF" "#90A4B4FF" "#87A0B4FF"
3 [7] "#7E9BB4FF" "#7597B4FF" "#6C93B4FF" "#638FB4FF" "#5A8BB4FF" "#5187B4FF"
4[13] "#4883B4FF" "#3F7FB4FF" "#367BB4FF" "#2D77B4FF" "#2473B4FF" "#1B6EB4FF"
5[19] "#126AB4FF" "#0966B4FF" "#0062B4FF"
参考资料链接
(http://www.sthda.com/english/wiki/colors-in-r)
题外话:但愿人长久,千里共婵娟。明天就是中秋节了,预祝各位中秋快乐,阖家团聚~