Package scatterplot3d

Similar documents
Scatterplot3d an R package for Visualizing Multivariate Data

Package sciplot. February 15, 2013

Package waterfall. R topics documented: February 15, Type Package. Version Date Title Waterfall Charts in R

Configuring Figure Regions with prepplot Ulrike Grömping 03 April 2018

Package EnQuireR. R topics documented: February 19, Type Package Title A package dedicated to questionnaires Version 0.

Graphics - Part III: Basic Graphics Continued

Package munfold. R topics documented: February 8, Type Package. Title Metric Unfolding. Version Date Author Martin Elff

AA BB CC DD EE. Introduction to Graphics in R

The nor1mix Package. June 12, 2007

Package areaplot. October 18, 2017

The nor1mix Package. August 3, 2006

Package desplot. R topics documented: April 3, 2018

Package sankey. R topics documented: October 22, 2017

Package beanplot. R topics documented: February 19, Type Package

Graphics in R STAT 133. Gaston Sanchez. Department of Statistics, UC Berkeley

Graphics #1. R Graphics Fundamentals & Scatter Plots

Package JBTools. R topics documented: June 2, 2015

Package basictrendline

Package fso. February 19, 2015

Package hextri. April 22, 2016

Plotting Complex Figures Using R. Simon Andrews v

Package pathdiagram. R topics documented: August 29, 2016

Package sspline. R topics documented: February 20, 2015

Package rtsplot. September 15, 2018

Package prettygraphs

Package mixphm. July 23, 2015

Package CLA. February 6, 2018

Package Mondrian. R topics documented: March 4, Type Package

Package gridextra. September 9, 2017

Statistical Programming with R

The BHH2 Package. July 27, 2006

Package wordcloud. August 24, 2018

Package MFDFA. April 18, 2018

Package feature. R topics documented: October 26, Version Date

Package smoothr. April 4, 2018

Package r2d2. February 20, 2015

IST 3108 Data Analysis and Graphics Using R Week 9

Package RTNduals. R topics documented: March 7, Type Package

Package edci. May 16, 2018

Package Grid2Polygons

Package multigraph. R topics documented: November 1, 2017

Package pca3d. February 17, 2017

3D Surface Plots with Groups

Package arphit. March 28, 2019

Sec 4.1 Coordinates and Scatter Plots. Coordinate Plane: Formed by two real number lines that intersect at a right angle.

Package multigraph. R topics documented: January 24, 2017

Package nprotreg. October 14, 2018

Package comphclust. May 4, 2017

Package osrm. November 13, 2017

Package ExceedanceTools

Package panelview. April 24, 2018

Correlation. January 12, 2019

Advanced Graphics with R

Package gains. September 12, 2017

Introduction Basics Simple Statistics Graphics. Using R for Data Analysis and Graphics. 4. Graphics

Package feature. R topics documented: July 8, Version Date 2013/07/08

The sspline Package. October 11, 2007

INTRODUCTION TO R. Basic Graphics

Package ConvergenceClubs

Package mmeta. R topics documented: March 28, 2017

Package scatterd3. March 10, 2018

Package sizemat. October 19, 2018

Intro to R Graphics Center for Social Science Computation and Research, 2010 Stephanie Lee, Dept of Sociology, University of Washington

Vocabulary Unit 2-3: Linear Functions & Healthy Lifestyles. Scale model a three dimensional model that is similar to a three dimensional object.

Package SFtools. June 28, 2017

Package Binarize. February 6, 2017

Package spark. July 21, 2017

Package ClustGeo. R topics documented: July 14, Type Package

Parallel Coordinate Plots

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package nonmem2r. April 5, 2018

Shrinkage of logarithmic fold changes

Package Combine. R topics documented: September 4, Type Package Title Game-Theoretic Probability Combination Version 1.

Package Rramas. November 25, 2017

Package RConics. R topics documented: February 19, Type Package Title Computations on Conics Version 1.0 Date Author Emanuel Huber

Package alphashape3d

Introduction to R. Biostatistics 615/815 Lecture 23

Package grimport. R topics documented: February 20, 2015

Package CorporaCoCo. R topics documented: November 23, 2017

Package MixSim. April 29, 2017

STATISTICAL LABORATORY, April 30th, 2010 BIVARIATE PROBABILITY DISTRIBUTIONS

Package JOP. February 19, 2015

Package gridgraphics

The misc3d Package. October 22, 2007

data visualization Show the Data Snow Month skimming deep waters

Package MmgraphR. R topics documented: September 14, Type Package

Az R adatelemzési nyelv

Package lvplot. August 29, 2016

Package pvclust. October 23, 2015

Package Ckmeans.1d.dp

Package pwrrasch. R topics documented: September 28, Type Package

Package replicatedpp2w

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package splicegear. R topics documented: December 4, Title splicegear Version Author Laurent Gautier

Package xroi. February 13, 2019

Package abf2. March 4, 2015

Package lvm4net. R topics documented: August 29, Title Latent Variable Models for Networks

Package arulesviz. April 24, 2018

PASS Sample Size Software

Package qicharts. October 7, 2014

Transcription:

Version 0.3-40 Date 2017-04-22 Title 3D Scatter Plot Package scatterplot3d April 22, 2017 Author Uwe Ligges <ligges@statistik.tu-dortmund.de>, Martin Maechler, Sarah Schnackenberg Maintainer Uwe Ligges <ligges@statistik.tu-dortmund.de> Description Plots a three dimensional (3D) point cloud. Depends R (>= 2.7.0) License GPL-2 Encoding latin1 Imports grdevices, graphics, stats NeedsCompilation no Repository CRAN Date/Publication 2017-04-22 16:17:10 UTC R topics documented: scatterplot3d......................................... 1 Index 7 scatterplot3d 3D Scatter Plot Description Plots a three dimensional (3D) point cloud. 1

2 scatterplot3d Usage scatterplot3d(x, y=null, z=null, color=par("col"), pch=par("pch"), main=null, sub=null, xlim=null, ylim=null, zlim=null, xlab=null, ylab=null, zlab=null, scale.y=1, angle=40, axis=true, tick.marks=true, label.tick.marks=true, x.ticklabs=null, y.ticklabs=null, z.ticklabs=null, y.margin.add=0, grid=true, box=true, lab=par("lab"), lab.z=mean(lab[1:2]), type="p", highlight.3d=false, mar=c(5,3,4,3)+0.1, bg=par("bg"), col.axis=par("col.axis"), col.grid="grey", col.lab=par("col.lab"), cex.symbols=par("cex"), cex.axis=0.8 * par("cex.axis"), cex.lab=par("cex.lab"), font.axis=par("font.axis"), font.lab=par("font.lab"), lty.axis=par("lty"), lty.grid=par("lty"), lty.hide=null, lty.hplot=par("lty"), log="", asp=na,...) Arguments x y z color pch main the coordinates of points in the plot. the y coordinates of points in the plot, optional if x is an appropriate structure. the z coordinates of points in the plot, optional if x is an appropriate structure. colors of points in the plot, optional if x is an appropriate structure. Will be ignored if highlight.3d = TRUE. plotting "character", i.e. symbol to use. an overall title for the plot. sub sub-title. xlim, ylim, zlim the x, y and z limits (min, max) of the plot. Note that setting enlarged limits may not work as exactly as expected (a known but unfixed bug). xlab, ylab, zlab titles for the x, y and z axis. scale.y angle axis scale of y axis related to x- and z axis. angle between x and y axis (Attention: result depends on scaling). a logical value indicating whether axes should be drawn on the plot. tick.marks a logical value indicating whether tick marks should be drawn on the plot (only if axis = TRUE). label.tick.marks a logical value indicating whether tick marks should be labeled on the plot (only if axis = TRUE and tick.marks = TRUE). x.ticklabs, y.ticklabs, z.ticklabs vector of tick mark labels. y.margin.add grid box add additional space between tick mark labels and axis label of the y axis a logical value indicating whether a grid should be drawn on the plot. a logical value indicating whether a box should be drawn around the plot.

scatterplot3d 3 Value lab lab.z type highlight.3d mar a numerical vector of the form c(x, y, len). The values of x and y give the (approximate) number of tickmarks on the x and y axes. the same as lab, but for z axis. character indicating the type of plot: "p" for points, "l" for lines, "h" for vertical lines to x-y-plane, etc. points will be drawn in different colors related to y coordinates (only if type = "p" or type = "h", else color will be used). On some devices not all colors can be displayed. In this case try the postscript device or use highlight.3d = FALSE. A numerical vector of the form c(bottom, left, top, right) which gives the lines of margin to be specified on the four sides of the plot. See section Values on how to change the setting back to the default / previous setting. bg background (fill) color for the open plot symbols given by pch = 21:25. col.axis, col.grid, col.lab the color to be used for axis / grid / axis labels. cex.symbols, cex.axis, cex.lab the magnification to be used for point symbols, axis annotation, labels relative to the current. font.axis, font.lab the font to be used for axis annotation / labels. lty.axis, lty.grid the line type to be used for axis / grid. lty.hide lty.hplot log asp line style used to plot non-visible edges (defaults of the lty.axis style) the line type to be used for vertical segments with type = "h". Not yet implemented! A character string which contains "x" (if the x axis is to be logarithmic), "y", "z", "xy", "xz", "yz", "xyz". numeric, giving the aspect ratio z/x or z/y, see Note.... more graphical parameters can be given as arguments, pch = 16 or pch = 20 may be nice. xyz.convert points3d plane3d function which converts coordinates from 3D (x, y, z) to 2D-projection (x, y) of scatterplot3d. Useful to plot objects into existing plot. function which draws points or lines into the existing plot. function which draws a plane into the existing plot: plane3d(intercept, x.coef = NULL, y.coef = NU "dashed", lty.box = NULL, draw_lines = TRUE, draw_polygon = FALSE, polygon_args = l Instead of Intercept a vector containing 3 elements or an (g)lm object can be specified. The argument lty.box allows to set a different line style for the intersecting lines in the box s walls. The arguments draw_lines and draw_polygon allow for choosing whether to represent the plane via line segments or as a solid surface, respectively. The list in polygon_args collects arguments to be passed to the underlying polygon call that draws a solid (or transparent) plane if draw_polygon=true.

4 scatterplot3d box3d par.mar function which refreshes the box surrounding the plot. As the function modifies the par("mar") settings of the current device and needs to keep these in case you add elements to the plot later on, you can change these back via par(object$par.mar) in case you want to add more plots with default margins to the current device. Note Some graphical parameters should only be set as arguments in scatterplot3d but not in a previous par() call. One of these is mar, which is also non-standard in another way: Users who want to extend an existing scatterplot3d graphic with another function than points3d, plane3d or box3d, should consider to set par(mar = c(b, l, t, r)) to the value of mar used in scatterplot3d, which defaults to c(5, 3, 4, 3) + 0.1. Other par arguments may be split into several arguments in scatterplot3d, e.g., for specifying the line type. And finally some of par arguments do not apply here, e.g., many of those for axis calculation. So we recommend to try the specification of graphical parameters at first as arguments in scatterplot3d and only if needed as arguments in previous par() call. If asp is a finite positive value then the window is set up so that one data unit in the x or y direction (the one that ist plotted horizontally - depends on angle -) is equal in length to asp one data unit in the z direction. The variation of asp is only reasonable if the default values x.ticklabs=null, y.ticklabs=null, z.ticklabs=null are not changed. Author(s) Uwe Ligges <ligges@statistik.tu-dortmund.de>, Martin Maechler, Sarah Schnackenberg References Ligges, U., and Maechler, M. (2003): Scatterplot3d an R Package for Visualizing Multivariate Data. Journal of Statistical Software 8(11), 1 20. http://www.jstatsoft.org/ See Also persp, plot, par. Examples ## On some devices not all colors can be displayed. ## Try the postscript device or use highlight.3d = FALSE. ## example 1 z <- seq(-10, 10, 0.01) x <- cos(z) y <- sin(z) scatterplot3d(x, y, z, highlight.3d=true, col.axis="blue", col.grid="lightblue", main="scatterplot3d - 1", pch=20) ## example 2 temp <- seq(-pi, 0, length = 50) x <- c(rep(1, 50) %*% t(cos(temp)))

scatterplot3d 5 y <- c(cos(temp) %*% t(sin(temp))) z <- c(sin(temp) %*% t(sin(temp))) scatterplot3d(x, y, z, highlight.3d=true, col.axis="blue", col.grid="lightblue", main="scatterplot3d - 2", pch=20) ## example 3 temp <- seq(-pi, 0, length = 50) x <- c(rep(1, 50) %*% t(cos(temp))) y <- c(cos(temp) %*% t(sin(temp))) z <- 10 * c(sin(temp) %*% t(sin(temp))) color <- rep("green", length(x)) temp <- seq(-10, 10, 0.01) x <- c(x, cos(temp)) y <- c(y, sin(temp)) z <- c(z, temp) color <- c(color, rep("red", length(temp))) scatterplot3d(x, y, z, color, pch=20, zlim=c(-2, 10), main="scatterplot3d - 3") ## example 4 my.mat <- matrix(runif(25), nrow=5) dimnames(my.mat) <- list(letters[1:5], letters[11:15]) my.mat # the matrix we want to plot... s3d.dat <- data.frame(cols=as.vector(col(my.mat)), rows=as.vector(row(my.mat)), value=as.vector(my.mat)) scatterplot3d(s3d.dat, type="h", lwd=5, pch=" ", x.ticklabs=colnames(my.mat), y.ticklabs=rownames(my.mat), color=grey(25:1/40), main="scatterplot3d - 4") ## example 5 data(trees) s3d <- scatterplot3d(trees, type="h", highlight.3d=true, angle=55, scale.y=0.7, pch=16, main="scatterplot3d - 5") # Now adding some points to the "scatterplot3d" s3d$points3d(seq(10,20,2), seq(85,60,-5), seq(60,10,-10), col="blue", type="h", pch=16) # Now adding a regression plane to the "scatterplot3d" attach(trees) my.lm <- lm(volume ~ Girth + Height) s3d$plane3d(my.lm, lty.box = "solid") ## example 6; by Martin Maechler cubedraw <- function(res3d, min = 0, max = 255, cex = 2, text. = FALSE) { ## Purpose: Draw nice cube with corners cube01 <- rbind(c(0,0,1), 0, c(1,0,0), c(1,1,0), 1, c(0,1,1), # < 6 outer c(1,0,1), c(0,1,0)) # <- "inner": fore- & back-ground cub <- min + (max-min)* cube01 ## visibile corners + lines: res3d$points3d(cub[c(1:6,1,7,3,7,5),], cex = cex, type = 'b', lty = 1)

6 scatterplot3d ## hidden corner + lines res3d$points3d(cub[c(2,8,4,8,6), ], cex = cex, type = 'b', lty = 3) if(text.)## debug text(res3d$xyz.convert(cub), labels=1:nrow(cub), col='tomato', cex=2) } ## 6 a) The named colors in R, i.e. colors() cc <- colors() crgb <- t(col2rgb(cc)) par(xpd = TRUE) rr <- scatterplot3d(crgb, color = cc, box = FALSE, angle = 24, xlim = c(-50, 300), ylim = c(-50, 300), zlim = c(-50, 300)) cubedraw(rr) ## 6 b) The rainbow colors from rainbow(201) rbc <- rainbow(201) Rrb <- t(col2rgb(rbc)) rr <- scatterplot3d(rrb, color = rbc, box = FALSE, angle = 24, xlim = c(-50, 300), ylim = c(-50, 300), zlim = c(-50, 300)) cubedraw(rr) rr$points3d(rrb, col = rbc, pch = 16)

Index Topic hplot scatterplot3d, 1 par, 4 persp, 4 plot, 4 polygon, 3 scatterplot3d, 1 7