跟着Nature Plant学图形颜色搭配 | caecopal包

写在前面

今天在Nature Plant(IF:16.0)期刊中看到文中的图形,进一步的查看后发现作者使用一个R包来进行图形颜色的搭配。就此机会也分享给大家,若你需要可以进一步查看及使用此包。

对于图形颜色的搭配,对于文章整体美观是非常重要。但是,我相信很多人对于自己的文章图形颜色搭配也是一个头疼的问题,包括自己。每次绘图时,总是在纠结自己整体图形颜色的搭配。若,我们仔细查看顶刊期刊的文章,他们的图形颜色搭配真舒服。有时候,真的应了那句话:顶刊就是顶刊,毋庸置疑。

文章网址

https://doi.org/10.1038/s41477-023-01513-x

正文Figure欣赏

Fig. 1
Fig. 2
Fig. 3
Fig. 4

使用calecopal包

R包网址:

https://github.com/an-bui/calecopal

安装

devtools::install_github("an-bui/calecopal")

可选颜色

颜色色彩搭配灵感来源

Redwoods
Calochortus catalinae
Chaparra
Superbloom
Big Sur

使用

library(calecopal)

# all palettes
names(cal_palettes)

创建Building palettes

cal_palette(name = "desert", n = 15, type = "continuous")
cal_palette("sierra1", n = 50, type = "continuous")

提供事例

library(tidyverse)

ggplot(chickwts %>%
           group_by(feed) %>%
           summarize(av = mean(weight),
                     total = length(weight)) %>%
           filter(feed != "casein"),
         aes(x = feed, y = av, fill = feed)) +
    geom_col() +
    scale_fill_manual(values = cal_palette("sierra1")) + ## 添加对应的颜色即可
    theme_bw()
ggplot(chickwts, aes(x = feed, y = weight, color = feed)) +
    geom_jitter(aes(color = feed), alpha = 0.8, width = 0.3, size = 2) +
    geom_boxplot(alpha = 0.2) +
    scale_color_manual(values = cal_palette("kelp1")) +
    theme_bw()

calecopal包颜色搭配

搭配模式选项

Complete list of palettes
 "sierra1"      "sierra2"      "chaparral1"   "chaparral2"   "chaparral3"
 "conifer"      "desert"       "wetland"      "oak"          "kelp1"
 "kelp2"        "coastaldune1" "coastaldune2" "superbloom1"  "superbloom2"
 "superbloom3"  "sbchannel"    "lake"         "fire"         "agriculture"
 "bigsur"       "figmtn"       "caqu"         "ceschscholzia""arbutus"
 "calochortus"  "grassdry"     "grasswet"     "sage"         "tidepool"
 "seagrass"     "bigsur2"      "bixby"        "redwood1"     "redwood2"
 "halfdome"     "creek"        "vermillion"   "canary"       "casj"
 "lupinus"      "dudleya"      "gayophytum"   "collinsia"    "buow"
 

颜色选择

cal_palettes <- list(
 ### release 1: June 2020
 sierra1 = c("#BD973D", "#5F5C29", "#3B7D6E", "#5792CC", "#4D5B75", "#262E43"),
 sierra2 = c("#FDD989", "#8BAD57", "#516238", "#4CA2B0", "#5A8B92", "#395B5F"),
 chaparral1 = c("#DCC27A", "#B0B9BE", "#63605F", "#985E5C", "#AEBFA8", "#F19B34"),
 chaparral2 = c("#D98A63", "#D9E4DC", "#C5D2D2", "#79B38F", "#9A9B5F", "#A7C2CD"),
 chaparral3 = c("#D3E3CA", "#BED6B3", "#92A587", "#4A5438", "#2F3525"),
 conifer = c("#CC7540", "#765043", "#A69260", "#979A6B", "#39692F"),
 desert = c("#F6EECF", "#ECD6AB", "#B09175", "#632D1F", "#291611"),
 wetland = c("#DED4C8", "#AD6F4F", "#AEC96F", "#2B3851", "#3F320D"),
 oak = c("#EFC68E", "#B58755", "#7C9867", "#4F5730","#7A5028"),
 kelp1 = c("#C70000", "#FFBF00", "#BE8333", "#54662C", "#009BB0", "#114C54"),
 kelp2 = c("#0FB2D3", "#026779", "#368000", "#3D6334", "#6D5A18"),
 coastaldune1 = c("#DCC8BA", "#DCD6C5", "#B4AA98", "#D7DCE4", "#444239"),
 coastaldune2 = c("#E2D78A", "#E4B3E2", "#90816E", "#523833", "#372E21"),
 superbloom1 = c("#B9C7E2", "#ECAB99", "#F1C100",  "#5B6530", "#9484B1"),
 superbloom2 = c("#DE7424", "#F5CA37", "#AD8D26", "#496849", "#654783"),
 superbloom3 = c("#E69512", "#D3105C", "#3B4F8E", "#3A5D3D", "#4C4976", "#6C91BD"),
 sbchannel = c("#A1CAF6", "#6592D6", "#4C6FA1", "#375377", "#1E2F46"),
 lake = c("#CECEB9", "#7AC9B7", "#6CA184", "#3793EC", "#2A3927"),
 fire = c("#B77B7B", "#FEEC44", "#F66C09", "#E60505", "#2C1B21"),
 agriculture = c("#A45C44", "#5A7F3C", "#CACA91", "#2C3B26", "#88B063"),
 bigsur = c("#E4DECE", "#ECBD95", "#9BB1BB", "#79ACBD", "#346575", "#0B4221"),
 figmtn = c("#E29244", "#FFAA00", "#D46F10", "#4CA49E", "#69B9FA", "#59A3F8", "#4B8FF7", "#5A7ECB", "#6B6D9F"),

 ### release 2: Sep 2020
 caqu = c("#E6DECC", "#F3E3C2", "#8F96A6", "#625D55", "#501F16"), # california quail
 eschscholzia = c("#F2B705", "#F29F05", "#F28705", "#D95204", "#A62F03"), # california poppy
 arbutus = c("#DFE3CE", "#B5C861", "#8AA789", "#CB8573", "#976153"), # pacific madrone
 calochortus = c("#CAC8CF", "#C9B3B5", "#8F706E", "#AF6E78", "#5C3327"), # catalinae
 grassdry = c("#E1BC8D", "#845B3E", "#5B4E23", "#35301C", "#4C5454"),
 grasswet = c("#4C4E32","#908E6C","#5D8FBC","#97C2E2","#17252A","#B4A480"),
 sage = c("#607860", "#304830", "#C0D8F0", "#909078", "#181818"),
 tidepool = c("#84A6A2","#4A5352","#151E2F","#D7C8C6","#BE5A47","#604A76"),
 seagrass = c("#5A870A", "#BDD0A2", "#555B53", "#6A4D3B", "#BEAB91", "#8F9BAB"),
 bigsur2 = c("#20618D", "#91AAC4", "#6B6C58", "#464724", "#83932D", "#CAB89F"),
 bixby = c("#286A81", "#045CB4", "#7F6F43", "#748B75", "#B8B196"),
 redwood1 = c("#303018", "#604830", "#609048", "#90A860", "#786048"),
 redwood2 = c("#304818", "#906030", "#486030", "#784830", "#181800"),
 halfdome = c("#A2A098", "#5E6B7B", "#233D3F", "#85ADCC", "#426714"),
 creek = c("#EBDAC9", "#CEAD96", "#CECFD4", "#686F60", "#455D44", "#23341E"),
 vermillion = c("#c39ca4","#e05959","#ac181d","#713d3f","#381f21"), # vermillion rockfish
 canary = c("#FFDBA5", "#FAB455", "#F28023", "#A5683C", "#B4450E"), # canary rockfish
 casj = c("#336887", "#8197A4", "#A9B4BC", "#B7AA9F", "#706A6B"),
 lupinus = c("#6C568C", "#9386A6", "#BFCDD9", "#7F8C72", "#607345"),
 dudleya = c("#7E8C69", "#E7A655", "#E59D7F", "#E38377", "#6D4847"),
 gayophytum = c("#AA767C", "#B7AF57", "#797014", "#C2607F", "#A65644"),
 collinsia = c("#9E8ABC", "#A99CD9", "#808C91", "#A7907B", "#A5BA92"),
 buow = c("#DED4CB", "#DBE38E", "#7E7576", "#A79787", "#3A2C21") # burrowing owl
)

已发表的文章图形鉴赏

文章图形颜色的搭配方案很多,也是我们作图所必备的“审美技能”之一。


往期文章:

1. 复现SCI文章系列专栏

2. 《生信知识库》,同步更新,易与搜索与管理。

3. 最全WGCNA教程(替换数据即可出全部结果与图形)


4. 精美图形绘制教程

5. 转录组分析教程


小杜的生信筆記,主要发表或收录生物信息学的教程,以及基于R的分析和可视化(包括数据分析,图形绘制等);分享感兴趣的文献和学习资料!!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,547评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,399评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,428评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,599评论 1 274
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,612评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,577评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,941评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,603评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,852评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,605评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,693评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,375评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,955评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,936评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,172评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,970评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,414评论 2 342

推荐阅读更多精彩内容