• R语言绘制两种不同形式的投影方法效果图


    library(plot3D)
    
    par(mfrow = c(1, 1))
    panelfirst <- function(pmat) {
      zmin <- min(-quakes$depth)
      XY <- trans3D(quakes$long, quakes$lat,
                    z = rep(zmin, nrow(quakes)), pmat = pmat)
      scatter2D(XY$x, XY$y, col = "black", pch = ".",
                cex = 2, add = TRUE, colkey = FALSE)
      xmin <- min(quakes$long)
      XY <- trans3D(x = rep(xmin, nrow(quakes)), y = quakes$lat,
                    z = -quakes$depth, pmat = pmat)
      scatter2D(XY$x, XY$y, col = "black", pch = ".",
                cex = 2, add = TRUE, colkey = FALSE)
    }
    
    
    library(scales)
    library(RColorBrewer)
    library(fields) 
    colormap <- colorRampPalette(rev(brewer.pal(11,'RdYlGn')))(100)#
    
    index <- ceiling(((prc <- 0.7 * quakes$mag/ diff(range(quakes$mag))) - min(prc) + 0.3)*100)
    for (i in seq(1,length(index)) ){
      prc[i]=colormap[index[i]]
    }
    
    
    pmar <- par(mar = c(5.1, 4.1, 4.1, 6.1))
    with(quakes, scatter3D(x = long, y = lat, z = -depth, #bgvar = mag,
                           pch = 21, cex = 1.5,col="black",bg=prc,
                           xlab = "longitude", ylab = "latitude",
                           zlab = "depth, km", 
                           ticktype = "detailed",#bty = "f",box = TRUE,
                           panel.first = panelfirst,
                           theta = 140, phi = 20, d=1.5,
                           colkey = FALSE)#list(length = 0.5, width = 0.5, cex.clab = 0.75))
    )
    colkey (col=colormap,clim=range(quakes$mag),clab = "Richter", add=TRUE, length=0.5,side = 4)
    
    
    #--------------------------------------------------------------------
    pmar <- par(mar = c(5.1, 4.1, 4.1, 6.1))
    with(quakes, scatter3D(x = long, y = lat, z = -depth, #bgvar = mag,
                           pch = 21, cex = 1.5,col="black",bg=prc,
                           xlab = "longitude", ylab = "latitude",
                           zlab = "depth, km", 
                           ticktype = "detailed",bty = "f",box = TRUE,
                           panel.first = panelfirst,
                           theta = 140, phi = 20, d=3,
                           colkey = FALSE)#list(length = 0.5, width = 0.5, cex.clab = 0.75))
    )
    colkey (col=colormap,clim=range(quakes$mag),clab = "Richter", add=TRUE, length=0.5,side = 4)
    
    #--------------------------------------------------------------------
    pmar <- par(mar = c(5.1, 4.1, 4.1, 6.1))
    with(quakes, scatter3D(x = long, y = lat, z = -depth, #bgvar = mag,
                           pch = 21, cex = 1.5,col="black",bg=prc,
                           xlab = "longitude", ylab = "latitude",
                           zlab = "depth, km", 
                           ticktype = "detailed",#bty = "f",box = TRUE,
                           panel.first = panelfirst,
                           theta = 140, phi = 20, d=30,
                           colkey = FALSE)#list(length = 0.5, width = 0.5, cex.clab = 0.75))
    )
    colkey (col=colormap,clim=range(quakes$mag),clab = "Richter", add=TRUE, length=0.5,side = 4)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Set1')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Set2')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Set3')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Pastel1')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Pastel2')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Blues')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Reds')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Accent')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'Paired')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'YlOrRd')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'PuBu')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'BuPu')))(100)#
    
    • 1

    在这里插入图片描述

    colormap <- colorRampPalette(rev(brewer.pal(11,'YlOrBr')))(100)#
    
    • 1

    在这里插入图片描述

  • 相关阅读:
    渗透测试-域内密码凭证获取
    做一个能对标阿里云的前端APM工具(下)
    Gopher进阶神器:拥抱刻意练习,从新手到大师。
    《Python数据科学项目实战》:开启数据科学之旅的实战指南!
    最受欢迎的程序员副业排行榜TOP6
    【Final Project】Kitti的双目视觉里程计(3)前端及整体过程理解
    Linux上部署MySQL5.6 rpm包数据库
    springboot+影院售票小程序 毕业设计-附源码111154
    #安装lnmp1.5到最后出现Error: MySQL install failed的解决方法#
    十大经典排序算法
  • 原文地址:https://blog.csdn.net/m0_38127487/article/details/127945562