• ggVennDiagram--绘制简单美观不同调色板的韦恩图1


    library(ggVennDiagram)
    library(ggplot2)
    genes <- paste0("gene",1:1000)
    set.seed(20210701)
    gene_list <- list(A = sample(genes,100),
                      B = sample(genes,200),
                      C = sample(genes,300),
                      D = sample(genes,200))
    
    # construct a Venn object
    venn = Venn(gene_list)
    data = process_data(venn, shape_id == "401")
    
    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "RdBu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Set1")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Set2")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Set3")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Pastel1")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Pastel2")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Pastel3")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Paired")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Darked2")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Accent")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Spectral")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "RdYlGn")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "RdYlBu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "RdGy")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "RdBu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "YlOrRd")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "YlOrBr")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "YlGnBu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "YlGn")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Reds")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "RdPu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Purples")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "PuRd")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "PuBuGn")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "PuBu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "OrRd")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Oranges")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Greys")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Greens")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "GnBu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "BuPu")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "BuGn")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    ggplot() +
      geom_sf(aes(fill = count), data = venn_region(data)) +
      geom_sf(aes(color = id), data = venn_setedge(data), show.legend = FALSE) +
      geom_sf_text(aes(label = name), data = venn_setlabel(data)) +
      geom_sf_label(aes(label = count), data = venn_region(data)) +
      theme_void()+ scale_fill_distiller(palette = "Blues")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    参考文献:
    https://cloud.tencent.com/developer/article/1965941
    开发工具:RStudio和微信截屏工具

  • 相关阅读:
    Android Target 31 升级全攻略 —— 记阿里首个超级 App 的坎坷升级之路
    k8s最新版本1.24.3基于containerd的集群部署、打包和Jenkins流水线定义
    Nodejs模块化
    [附源码]计算机毕业设计JAVAjsp网上购物商城
    JAVA程序运行流程
    SAP BC 源代码搜索
    IP-Guard管控应用程序运行有哪几种方式?
    Xmake v2.8.5 发布,支持链接排序和单元测试
    Spring Cloud Gateway中session共享
    软件工程毕业设计课题(46)微信小程序毕业设计JAVA核酸预约小程序系统毕设作品项目
  • 原文地址:https://blog.csdn.net/m0_38127487/article/details/127830645