3D散布图
> library(scatterplot3d) Warning message: 程辑包‘scatterplot3d’是用R版本3.3.3 来建造的 > scatterplot3d(iris$Sepal.Width,iris$Sepal.Length,iris$Petal.Width)
交互式
> plot3d(iris$Petal.Width,iris$Sepal.Length,iris$Sepal.Width)
数据矩阵展示的2D热图区
> distMatrix <- as.matrix(dist(iris[,1:4])) > heatmap(distMatrix)
等级图
> library(lattice) Warning message: 程辑包‘lattice’是用R版本3.3.3 来建造的
> levelplot(Petal.Width~Sepal.Length*Sepal.Width,iris,cuts = 9, col.regions = grey.colors(10)[10:1])
等高图
> filled.contour(volcano,color = terrain.colors, asp = 1, plot.axes = contour(volcano, add = T ) )
数据矩阵的另一种图像展示是3D曲面图
> persp(volcano,theta = 25, phi = 30, expand = 0.5, col = "lightblue")
平行坐标为多维数据提供了良好的可视化效果
> parcoord(iris[1:4], col = iris$Species)
ggplot2包中支持复杂的图像,对探索数据非常重要。
将图标保存到文件中
> # save as a PDF file > pdf("myPlot.pdf") > x <- 1:50 > plot(x, log(x)) > graphics.off()