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


相关栏目:『科技前沿
SpaceX冲击10万亿!投资人揭秘:为什么马斯克无人能敌? 2025-12-16 [74]
GPT-5.2发布,能力超人类11倍!谷歌揭露一个致命弱点,这才是普通人的活路 2025-12-16 [60]
AI泡沫的深层焦虑:错过,是最大的失败 2025-12-09 [180]
2025年人工智能现状:智能体、创新与转型 2025-12-09 [157]
英伟达反击AI泡沫论:七页备忘录回应十二项质疑 2025-12-09 [135]
算力产业链核心赛道:谷歌TPU全解析 2025-12-09 [228]
硅谷惊天丑闻!北大毕业女CEO逼10万人成瘾,狂赚上亿,口出狂言! 2025-12-09 [247]
美国“创世纪计划”:一场关于AI主导权的国家行动 2025-12-09 [172]
OECD发布AI能力指标评估量表 2025-11-30 [422]
麦肯锡2025年技术趋势展望:13大前沿技术趋势,有望重塑全球格局 2025-11-30 [549]
相关栏目更多文章
最新图文:
马亮:做院长就能够发更多论文?论文发表是不是一场“权力的游戏”? :印裔人才在美碾压华裔:我们可以从印度教育中学到什么? :北京452万人将从北京迁至雄安(附部分央企名单) :《2019全球肿瘤趋势报告》 :阿尔茨海默病预防与干预核心讯息图解 :引力波天文台或有助搜寻暗物质粒子 :Sail Through the Mist - SoCal Innovation Forum 2019(10/5) 游天龙:《唐人街》是如何炼成的:UCLA社会学教授周敏的学术之路
更多最新图文
更多《即时通讯》>>
 
打印本文章
 
您的名字:
电子邮件:
留言内容:
注意: 留言内容不要超过4000字,否则会被截断。
未 审 核:  是
  
关于我们联系我们申请加入后台管理设为主页加入收藏
美国华裔教授专家网版权所有,谢绝拷贝。如欲选登或发表,请与美国华裔教授专家网联系。
Copyright © 2025 ScholarsUpdate.com. All Rights Reserved.