用户名:  密码:   
网站首页即时通讯活动公告最新消息科技前沿学人动向两岸三地人在海外历届活动关于我们联系我们申请加入
栏目导航 — 美国华裔教授专家网科技动向科技前沿
关键字  范围   
 
《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)
作者:置身数内 数新社 | 2024/3/28 14:27:10 | 浏览:3280 | 评论: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-10-12 [410]
详解2025诺贝尔物理学奖:他们在人类尺度上观测到量子力学 2025-10-12 [461]
炸裂发布!人工智能,重磅传来! 2025-10-06 [573]
黄仁勋最新讲话:下一个10年,你的工作方式会被彻底改变 2025-10-06 [659]
AI 能取代科学记者? ChatGPT 爱用「突破性」却难掌握研究细节 2025-10-02 [677]
为什么“具身智能”是 AI 的下一个前沿 2025-10-02 [705]
AI如何重塑未来人类健康 2025-09-23 [976]
为什么忽视人工智能在企业中的应用会让你在 2025 年付出代价? 2025-09-11 [1496]
特斯拉宏图4.0:从电动车到人形机器人! 2025-09-11 [1589]
AI杀死首个世界名校?全球TOP 3「翻译界哈佛」倒闭,毕业校友成绝版 2025-09-11 [1582]
相关栏目更多文章
最新图文:
:《2019全球肿瘤趋势报告》 :阿尔茨海默病预防与干预核心讯息图解 :引力波天文台或有助搜寻暗物质粒子 :Sail Through the Mist - SoCal Innovation Forum 2019(10/5) 游天龙:《唐人街》是如何炼成的:UCLA社会学教授周敏的学术之路 :“为什么海外华人那么爱国,但是让他回国却不愿意?...“ :学术出版巨头Elsevier 彻查433名审稿人“强迫引用”黑幕 :中国336个国家重点实验室布局
更多最新图文
更多《即时通讯》>>
 
打印本文章
 
您的名字:
电子邮件:
留言内容:
注意: 留言内容不要超过4000字,否则会被截断。
未 审 核:  是
  
关于我们联系我们申请加入后台管理设为主页加入收藏
美国华裔教授专家网版权所有,谢绝拷贝。如欲选登或发表,请与美国华裔教授专家网联系。
Copyright © 2025 ScholarsUpdate.com. All Rights Reserved.