美文网首页
可视化也需要赛博朋克

可视化也需要赛博朋克

作者: R语言数据分析指南 | 来源:发表于2021-03-05 20:35 被阅读0次

    分享R中创建CyberPunk的小例子,喜欢的小伙伴可以关注我的公众号R语言数据分析指南,持续分享更多优质资源

    devtools::install_github("delabj/ggCyberPunk")
    library(tidyverse)
    library(ggCyberPunk)
    

    geom_glowing_area()

    赛博朋克/迪斯科/霓虹灯氛围的发光区域图

    geom_glowing_area(alpha = 1, size= 1,glow_alpha = 0.03)

    alpha:基线的Alpha级别:基线的size大小 glow_alpha:设置发光层的Alpha级别

    例子1

    df = data.frame(A=c(1,4,4,6,7,5,1),
                    B=c(4,3,5,7,5,6,7),
                    Time=c(1,2,3,4,5,6,7)) %>%
      pivot_longer(cols = c(A,B),names_to = "group", values_to = "count")
    
    df %>%
      ggplot(aes(x=Time, y = count, color = group, fill= group))+
      geom_glowing_area()+
      theme_cyberpunk()+
      scale_fill_cyberpunk("zune")+
      scale_color_cyberpunk("zune")+
      ggtitle("geom_glowing_area()", subtitle = "From ggCyberPunk")
    

    例子2

    df = data.frame(A=c(1,4,4,6,7,5,1),
                    B=c(4,3,5,7,5,6,7),
                    Time=c(1,2,3,4,5,6,7)) %>%
      pivot_longer(cols = c(A,B),names_to = "group", values_to = "count")
    
    
    df %>%
      ggplot(aes(x=Time, y = count, color = group, fill= group))+
      geom_glowing_line()+
      theme_cyberpunk()+
      scale_color_cyberpunk()+
      ggtitle("geom_glowing_line()", subtitle = "From ggCyberPunk")
    

    例子3

    df = data.frame(A=c(1,4,4,6,7,5,1),
                    B=c(4,3,5,7,5,6,7),
                    Time=c(1,2,3,4,5,6,7)) %>%
      pivot_longer(cols = c(A,B),names_to = "group", values_to = "count")
    
    
    df %>%
      ggplot(aes(x=Time, y = count, color = group, fill= group))+
      geom_linesaber()+
      theme_cyberpunk()+
      scale_color_cyberpunk()+
      ggtitle("geom_linesaber()", subtitle = "From ggCyberPunk")
    

    原文链接:https://mp.weixin.qq.com/s/_JyjH0rOUUEcwhvAFKW2Xg

    相关文章

      网友评论

          本文标题:可视化也需要赛博朋克

          本文链接:https://www.haomeiwen.com/subject/vrsfqltx.html