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


相关栏目:『科技前沿
为什么忽视人工智能在企业中的应用会让你在 2025 年付出代价? 2025-09-11 [43]
特斯拉宏图4.0:从电动车到人形机器人! 2025-09-11 [50]
AI杀死首个世界名校?全球TOP 3「翻译界哈佛」倒闭,毕业校友成绝版 2025-09-11 [35]
AI与人形机器人深度融合:商业化路径逐清晰 丨 2025中报专题 2025-09-11 [70]
一文看懂“人工智能+”的未来10年 2025-09-11 [72]
大模型如何推理?斯坦福CS25重要一课,DeepMind首席科学家主讲 2025-09-02 [354]
史上最著名的物理实验,为啥伽利略根本不用做 2025-09-02 [322]
微软为了AI,买了17亿美金的屎...... 2025-08-05 [1218]
东北热过三亚,沙漠种出水稻,毒虫开始北上,气候彻底乱套了 2025-08-05 [1216]
全球最“神秘”公司:靠卖颜色,一年狂赚2.5亿! 2025-08-01 [1308]
相关栏目更多文章
最新图文:
Colleen Flaherty 翻译 刘勤:MIT教授发文《美国经济评论》 :生命科学受益于明星科学家们的死亡 :北京和上海金融人的最新鄙视链 :日本政府《氢能利用进度表》 :美国《2016-2045年新兴科技趋势报告》 :天津工业大学“经纬英才”引进计划 :浙江财经大学国际青年学者论坛的邀请函 (10/31-11/1) :美国加大审查范围 北大多名美国留学生遭联邦调查局质询 :天安门广场喜迎“十一”花团锦簇的美丽景象
更多最新图文
更多《即时通讯》>>
 
打印本文章
 
您的名字:
电子邮件:
留言内容:
注意: 留言内容不要超过4000字,否则会被截断。
未 审 核:  是
  
关于我们联系我们申请加入后台管理设为主页加入收藏
美国华裔教授专家网版权所有,谢绝拷贝。如欲选登或发表,请与美国华裔教授专家网联系。
Copyright © 2025 ScholarsUpdate.com. All Rights Reserved.