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,
pch = 21, cex = 1.5,col="black",bg=prc,
xlab = "longitude", ylab = "latitude",
zlab = "depth, km",
ticktype = "detailed",
panel.first = panelfirst,
theta = 140, phi = 20, d=1.5,
colkey = FALSE)
)
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,
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)
)
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,
pch = 21, cex = 1.5,col="black",bg=prc,
xlab = "longitude", ylab = "latitude",
zlab = "depth, km",
ticktype = "detailed",
panel.first = panelfirst,
theta = 140, phi = 20, d=30,
colkey = FALSE)
)
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)

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

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

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

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

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

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

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

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

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

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

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

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