用户名:  密码:   
网站首页即时通讯活动公告最新消息科技前沿学人动向两岸三地人在海外历届活动关于我们联系我们申请加入
栏目导航 — 美国华裔教授专家网科技动向科技前沿
关键字  范围   
 
《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)
作者:置身数内 数新社 | 2024/3/28 14:27:10 | 浏览:279 | 评论:0

小数今天给大家分享几组Nature中的配色方案,学学大佬们的图都是怎么配色的。

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

1.配色方案一

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

library(tidyverse)


data = readxl::read_xlsx("./data/MOESM21_ESM.xlsx")
data %>%
  pivot_longer(-c(Condition, Lineage),
               names_to = "obs", values_to = "Number of cells")-> df
##Figure01
pal = c("#f9eb77", "#04ced1", "#ed51d0")
ggplot(data = df,
       aes(x=Lineage, y=`Number of cells`))+
  geom_bar(aes(fill = Lineage),
           stat = "summary", fun="mean", color="grey20", width = 0.75)+
  stat_summary(geom = "errorbar", fun.data = "mean_se",
               width=0.25)+
  geom_jitter(width = 0.3, shape=21, color="grey20", fill="white", size=2, stroke=1)+
  scale_x_discrete(limits = c("EPI", "TE", "PrE"))+
  scale_y_continuous(limits = c(0, 300),
                     breaks = seq(0, 300, 100),
                     expand = c(0, 0))+
  scale_fill_manual(values = pal,
                    limits = c("EPI", "TE", "PrE"),
                    guide = "none")+
  guides(y = guide_axis(cap = "upper"))+
  facet_wrap(~Condition, axes = "margins", strip.position = "bottom")+
  theme_classic()+
  theme(strip.placement = "outside",
        strip.background = element_rect(color = NA),
        axis.title.x = element_blank())


2.配色方案二

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

pal = c("#e38d8c", "#f1b74e", "#66b0d7")
ggplot(data = df,
       aes(x=Lineage, y=`Number of cells`))+
  geom_bar(aes(fill = Lineage),
           stat = "summary", fun="mean", color="grey20", width = 0.75)+
  stat_summary(geom = "errorbar", fun.data = "mean_se",
               width=0.25)+
  geom_jitter(width = 0.3, shape=21, color="grey20", fill="white", size=2, stroke=1)+
  scale_x_discrete(limits = c("EPI", "TE", "PrE"))+
  scale_y_continuous(limits = c(0, 300),
                     breaks = seq(0, 300, 100),
                     expand = c(0, 0))+
  scale_fill_manual(values = pal,
                    limits = c("EPI", "TE", "PrE"),
                    guide = "none")+
  guides(y = guide_axis(cap = "upper"))+
  facet_wrap(~Condition, axes = "margins", strip.position = "bottom")+
  theme_classic()+
  theme(strip.placement = "outside",
        strip.background = element_rect(color = NA),
        axis.title.x = element_blank())


3.配色方案三

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)

pal = c("#862a2d", "#468099", "#fcfcfc")
ggplot(data = df,
       aes(x=Lineage, y=`Number of cells`))+
  geom_bar(aes(fill = Lineage),
           stat = "summary", fun="mean", color="grey20", width = 0.75)+
  stat_summary(geom = "errorbar", fun.data = "mean_se",
               width=0.25)+
  geom_jitter(width = 0.3, shape=21, color="grey20", fill="white", size=2, stroke=1)+
  scale_x_discrete(limits = c("EPI", "TE", "PrE"))+
  scale_y_continuous(limits = c(0, 300),
                     breaks = seq(0, 300, 100),
                     expand = c(0, 0))+
  scale_fill_manual(values = pal,
                    limits = c("EPI", "TE", "PrE"),
                    guide = "none")+
  guides(y = guide_axis(cap = "upper"))+
  facet_wrap(~Condition, axes = "margins", strip.position = "bottom")+
  theme_classic()+
  theme(strip.placement = "outside",
        strip.background = element_rect(color = NA),
        axis.title.x = element_blank())


相关栏目:『科技前沿
电子皮肤-具有高拉伸性且可定制化的微针电极阵列 2024-05-04 [15]
跨越300多年的接力:受陶哲轩启发,数学家决定用AI形式化费马大定理的证明 2024-05-04 [21]
全新神经网络架构KAN一夜爆火!200参数顶30万,MIT华人一作,轻松复现Nature封面AI数学研究 2024-05-04 [20]
历史性的飞行:美空军部长乘人工智能战斗机起飞体验空战 2024-05-03 [34]
神秘大模型一夜刷屏,能力太强被疑GPT-4.5,奥特曼避而不答打哑谜 2024-05-02 [31]
《Science》封面挑战现代教科书,一个长达数十年的谜团被解开了 2024-05-02 [31]
数不清的蜘蛛!欧空局探测器在火星“古城废墟”中拍到惊悚照片 2024-05-02 [33]
根据线粒体基因进行过滤 2024-05-02 [23]
把10万块AI 芯片部署在同一地区电网就会崩溃 2024-04-29 [131]
十个伟大的物理实验,你知道多少个? 2024-04-28 [90]
相关栏目更多文章
最新图文:
:浙江财经大学国际青年学者论坛的邀请函 (10/31-11/1) :美国加大审查范围 北大多名美国留学生遭联邦调查局质询 :天安门广场喜迎“十一”花团锦簇的美丽景象 马亮:做院长就能够发更多论文?论文发表是不是一场“权力的游戏”? :印裔人才在美碾压华裔:我们可以从印度教育中学到什么? :北京452万人将从北京迁至雄安(附部分央企名单) :《2019全球肿瘤趋势报告》 :阿尔茨海默病预防与干预核心讯息图解
更多最新图文
更多《即时通讯》>>
 
打印本文章
 
您的名字:
电子邮件:
留言内容:
注意: 留言内容不要超过4000字,否则会被截断。
未 审 核:  是
  
关于我们联系我们申请加入后台管理设为主页加入收藏
美国华裔教授专家网版权所有,谢绝拷贝。如欲选登或发表,请与美国华裔教授专家网联系。
Copyright © 2024 ScholarsUpdate.com. All Rights Reserved.