Nathalie Vialaneix and Sébastien Déjean
12 octobre 2018
Why?
ggplot2
graphics to interactive graphics Evaluation of the different solution on http://ouzor.github.io/blog/2014/11/21/interactive-visualizations.html (maybe a bit outdated).
library(rgl)
x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x, y)
plot3d(x, y, z, col = rainbow(1000))
Open a new graphic device outside R or Rstudio
Zoom and rotation using the mouse
x <- seq(-10, 10, length = 30)
y <- x
f <- function(x, y) { r <- sqrt(x^2 + y^2); 10 * sin(r)/r }
z <- outer(x, y, f)
z[is.na(z)] <- 1
open3d()
bg3d("white")
material3d(col = "black")
persp3d(x, y, z, aspect = c(1, 1, 0.5), col = "lightpink",
xlab = "X", ylab = "Y", zlab = "Sinc( r )")
The Obligatory Mathematical surface!
Many other possibilities: cube3d
, decorated3d
, ellipse3d
…
library(iplots)
data(cars)
iplot(cars$speed, cars$dist, ptDiam=8)
ihist(cars$speed)
Interactivity between several graphical devices opened outside R or Rstudio
Points selected on one plot are highlighted on the others
library(MASS)
data(Cars93)
imosaic(Cars93$AirBags, Cars93$DriveTrain)
ibar(Cars93$AirBags)
ibar(Cars93$DriveTrain)