美文网首页
R语言mapsf包,mf_get_pal获取调色板

R语言mapsf包,mf_get_pal获取调色板

作者: youmigo | 来源:发表于2021-07-13 02:28 被阅读0次

    R语言mapsf包,mf_get_pal获取调色板

    # Fri Jun 25 12:20:35 2021 -
    
    # 字符编码:UTF-8
    # R 版本:R x64 4.1 for window 10
    # cgh163email@163.com
    # 个人笔记不负责任,拎了个梨🍐✨
    # .rs.restartR()
    require(mapsf)
    rm(list = ls());gc()
    
    ?   mf_get_pal  #   获取调色板。
    cols <- mf_get_pal(n = 10, pal = "Reds 2")
    plot(1:10, rep(1, 10), bg = cols, pch = 22, cex = 4)
    
    cols <- mf_get_pal(n = c(3, 7), pal = c("Reds 2", "Greens"))
    plot(1:10, rep(1, 10), bg = cols, pch = 22, cex = 4)
    cols <- mf_get_pal(n = c(5, 5), pal = c("Reds 2", "Greens"))
    plot(1:10, rep(1, 10), bg = cols, pch = 22, cex = 4)
    cols <- mf_get_pal(n = c(7, 3), pal = c("Reds 2", "Greens"))
    plot(1:10, rep(1, 10), bg = cols, pch = 22, cex = 4)
    cols <- mf_get_pal(n = c(5, 5), pal = c("Reds 2", "Greens"), neutral = "grey")
    plot(1:11, rep(1, 11), bg = cols, pch = 22, cex = 4)
    opar <- par(bg = "black")
    cols <- mf_get_pal(n = c(7, 3), pal = c("Reds 2", "Greens"), alpha = c(.3, .7))
    plot(1:10, rep(1, 10), bg = cols, pch = 22, cex = 4)
    par(opar)
    cols <- mf_get_pal(
      n = c(5, 5), pal = c("Reds 2", "Greens"),
      rev = c(TRUE, TRUE)
    )
    plot(1:10, rep(1, 10), bg = cols, pch = 22, cex = 4)
    dev.copy(png, "1.png");dev.off()
    
    
    image.png
    image.png

    相关文章

      网友评论

          本文标题:R语言mapsf包,mf_get_pal获取调色板

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