用户名:  密码:   
网站首页即时通讯活动公告最新消息科技前沿学人动向两岸三地人在海外历届活动关于我们联系我们申请加入
栏目导航 — 美国华裔教授专家网科技动向科技前沿
关键字  范围   
 
《Nature》中的顶级配色,做出来的图太养眼了!(附作图代码)
作者:置身数内 数新社 | 2024/3/28 14:27:10 | 浏览:3571 | 评论: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 [117]
GPT-5.2发布,能力超人类11倍!谷歌揭露一个致命弱点,这才是普通人的活路 2025-12-16 [103]
AI泡沫的深层焦虑:错过,是最大的失败 2025-12-09 [238]
2025年人工智能现状:智能体、创新与转型 2025-12-09 [218]
英伟达反击AI泡沫论:七页备忘录回应十二项质疑 2025-12-09 [201]
算力产业链核心赛道:谷歌TPU全解析 2025-12-09 [307]
硅谷惊天丑闻!北大毕业女CEO逼10万人成瘾,狂赚上亿,口出狂言! 2025-12-09 [332]
美国“创世纪计划”:一场关于AI主导权的国家行动 2025-12-09 [245]
OECD发布AI能力指标评估量表 2025-11-30 [487]
麦肯锡2025年技术趋势展望:13大前沿技术趋势,有望重塑全球格局 2025-11-30 [626]
相关栏目更多文章
最新图文:
:大数据分析图解:2019中国企业500强 张梦然:英国惠康桑格研究所:人体内的微生物与出生方式有关 :美众议院将调查华裔部长赵小兰“利用职权为家族谋利“ :UCLA CCS 2019 Fall Quarter Lecture Series Overview 谭晶晶:美国科技界高度关注中国科技创新进展 :推荐:2019年底前中国高校重要学术论坛(10月 - 12 月) :黄奇帆:今后10年,中国经济将发生5个历史性变化 :为了在外太空住,人们都设计过怎样的房子?
更多最新图文
更多《即时通讯》>>
 
打印本文章
 
您的名字:
电子邮件:
留言内容:
注意: 留言内容不要超过4000字,否则会被截断。
未 审 核:  是
  
关于我们联系我们申请加入后台管理设为主页加入收藏
美国华裔教授专家网版权所有,谢绝拷贝。如欲选登或发表,请与美国华裔教授专家网联系。
Copyright © 2025 ScholarsUpdate.com. All Rights Reserved.