top of page

#Librerías necesarias

install.packages("rgl")

install.packages("plot3Drgl")

install.packages("magick")

library("magick")

library("rgl")

library("plot3Drgl")

#Codigo

require(plot3D)

require(plot3Drgl)
lon <- seq(165.5, 188.5, length.out = 30)
lat <- seq(-38.5, -10, length.out = 30)
xy <- table(cut(quakes$long, lon),
            cut(quakes$lat, lat))
xmid <- 0.5*(lon[-1] + lon[-length(lon)])
ymid <- 0.5*(lat[-1] + lat[-length(lat)])

par (mar = par("mar") + c(0, 0, 0, 2))
hist3D(x = xmid, y = ymid, z = xy,
       zlim = c(-20, 40), main = "TERREMOTOS",
       ylab = "LATITUD", xlab = "LONGITUD",
       zlab = "PROFUNDIDAD", bty= "g", phi = 5, theta = 25,
       shade = 0.2, col = "white", border = "black",
       d = 1, ticktype = "detailed")

with (quakes, scatter3D(x = long, y = lat, z = rep(-20, length.out = length(long)), 
                        colvar = quakes$depth, col = gg.col(100), 
                        add = TRUE, pch = 18, clab = c("Magnitud", "m"),
                        colkey = list(length = 0.5, width = 0.5, 
                                      dist = 0.05, cex.axis = 0.8, cex.clab = 0.8)
))  

plotrgl (lighting = TRUE, smooth = FALSE)
 

#Giro Automatico

play3d( spin3d( axis = c(0, 0, 1), rpm = 7), duration = 100 )

# O Generar Gif

movie3d( spin3d( axis = c(0, 0, 1), rpm = 7),
         duration = 10, dir = getwd(),
         type = "gif", clean =  TRUE )

###################################################

install.packages("rgl")

install.packages("plot3Drgl")

install.packages("magick")

library("magick")

library("rgl")

library("plot3Drgl")

require(plot3D)

require(plot3Drgl)
lon <- seq(165.5, 188.5, length.out = 30)
lat <- seq(-38.5, -10, length.out = 30)
xy <- table(cut(quakes$long, lon),
            cut(quakes$lat, lat))
xmid <- 0.5*(lon[-1] + lon[-length(lon)])
ymid <- 0.5*(lat[-1] + lat[-length(lat)])

par (mar = par("mar") + c(0, 0, 0, 2))
hist3D(x = xmid, y = ymid, z = xy,
       zlim = c(-20, 40), main = "TERREMOTOS",
       ylab = "LATITUD", xlab = "LONGITUD",
       zlab = "PROFUNDIDAD", bty= "g", phi = 5, theta = 25,
       shade = 0.2, col = "white", border = "black",
       d = 1, ticktype = "detailed")

with (quakes, scatter3D(x = long, y = lat, z = rep(-20, length.out = length(long)), 
                        colvar = quakes$depth, col = gg.col(100), 
                        add = TRUE, pch = 18, clab = c("Magnitud", "m"),
                        colkey = list(length = 0.5, width = 0.5, 
                                      dist = 0.05, cex.axis = 0.8, cex.clab = 0.8)
))  

plotrgl (lighting = TRUE, smooth = FALSE)

play3d( spin3d( axis = c(0, 0, 1), rpm = 7), duration = 100 );

###################################################

”Bien! Mensaje recibido

  • b-facebook
  • Twitter Round
bottom of page