bar3d(data, row.labels = rownames(data), col.labels = colnames(data), metalabels = NULL, filename = "out.wrl", type = "vrml", space = 0.5, cols = rainbow(length(as.matrix(data))), rcols = NULL, ccols = NULL, origin = c(0, 0, 0), scalefac = 4, lab.axis = c("X-axis", "Y-axis", "Z-axis"), lab.vertical = FALSE, col.axis = "black", showaxis = TRUE, autoscale = TRUE, ignore_zeros = TRUE, col.lab = "black", col.bg = "white", cex.lab = 1, cex.rowlab = 1, cex.collab = 1, htmlout = NULL, hwidth = 1200, hheight = 800, showlegend = TRUE, vrml_navigation = "EXAMINE", vrml_transparency = 0, vrml_fov = 0.785, vrml_pos = rep(scalefac + 4, 3), vrml_dir = c(0.19, 0.45, 0.87, 2.45), lg3d_ambientlight = 0.5)
curdir <- getwd()
outdir <- tempdir()
setwd(outdir)
# Height map visualization of geographical data
# with colors corresponding to different height levels
colpalette <- terrain.colors(max(volcano)-min(volcano)+1)
cols <- colpalette[as.vector(t(volcano))-min(volcano)+1]
bar3d(volcano, col.bg = "white", cols = cols,
type = "vrml", space = 0, showaxis = FALSE,
filename = "volcano.wrl", htmlout = "volcano.html")
# show the output in a web-browser
# (VRML-plugin must be installed!)
if(file.exists(paste("file://",file.path(outdir,
"volcano.html"), sep = "")))
{
browseURL(paste("file://",file.path(outdir,
"volcano.html"), sep = ""))
}
# bar plot for a data matrix with numerical metalabels
mat <- matrix(9:1, nrow = 3)
rownames(mat) <- paste('row',1:3)
colnames(mat) <- paste('col',1:3)
bar3d(mat, space = 1, metalabels = 1:9, col.bg = "white",
col.axis = "blue", col.lab = "black", type = "vrml",
filename = "barplot.wrl", htmlout = "barplot.html")
# show the output in a web-browser
# (VRML-plugin must be installed!)
if(file.exists(paste("file://",file.path(outdir,
"barplot.html"), sep = "")))
{
browseURL(paste("file://",file.path(outdir,
"barplot.html"), sep = ""))
}
# Height map visualization of very rough and highly
# simplified topographic data for the United Kingdom
data(uk_topo)
bar3d(uk_topo, autoscale = FALSE, cols = "blue",
space = 0, showaxis = FALSE, filename = "uk_topo.wrl",
htmlout = "uk_topo.html")
setwd(curdir)
Run the code above in your browser using DataLab