# G3D Example -- source code file g3d.r # scatterplot3d function uses the scatterplot3d package. # Issue install.packages("scatterplot3d") before # running this script. # Read and print iris data frame. iris = read.table("iris.txt", header=T, skip=3) cat("iris data frame:\n") print(iris) # Need this library to use scatterplot3d function. library(scatterplot3d) # Plot iris data. attach(iris) png("iris.png") # First three arguments of scatterplot3d function # are x, y, and z coordinates. scatterplot3d(petlen, petwid, sepwid, pch=species, type="h", main="Fisher 1936 Iris Data", xlab="Petal Length", ylab="Penal Width", zlab="Sepal Width") dev.off( )