Interchangeability of spaces

3-d scatter plots of Oregon climate station data

library(scatterplot3d)
library(RColorBrewer)
attach(orstationc)

oldpar <- par(mfcol=c(2,2), cex.lab=0.7, cex.axis=1.0)

# plot pann ~ lon, lat
plotvar <- pann # pick a variable to plot
nclr <- 8 # number of colors
plotclr <- brewer.pal(nclr,"Blues") # get the colors
colornum <- cut(rank(plotvar), nclr, labels=FALSE)
colcode <- plotclr[colornum] # assign color

# scatter plot
plot.angle <- 45
scatterplot3d(lon, lat, pann, type="h", angle=plot.angle, color=colcode,
pch=20, cex.symbols=2, col.axis="gray", col.grid="gray")


# plot tann ~ lon, lat
plotvar <- tann # pick a variable to plot
nclr <- 8 # number of colors
plotclr <- brewer.pal(nclr,"PuOr")[nclr:1] # get the colors
colornum <- cut(rank(plotvar), nclr, labels=FALSE)
colcode <- plotclr[colornum] # assign color

# scatter plot
plot.angle <- 45
scatterplot3d(lon, lat, tann, type="h", angle=plot.angle, color=colcode,
pch=20, cex.symbols=2, col.axis="gray", col.grid="gray")


# plot lon ~ tann, pann
plotvar <- lon # pick a variable to plot
nclr <- 8 # number of colors
plotclr <- brewer.pal(nclr,"BuPu") # get the colors
colornum <- cut(rank(plotvar), nclr, labels=FALSE)
colcode <- plotclr[colornum] # assign color

# scatter plot
plot.angle <- 315
scatterplot3d(tann, pann, lon, type="h", angle=plot.angle, color=colcode,
pch=20, cex.symbols=2, col.axis="gray", col.grid="gray")


# plot lat ~ tann, pann
plotvar <- lat # pick a variable to plot
nclr <- 8 # number of colors
plotclr <- brewer.pal(nclr,"Greens") # get the colors
colornum <- cut(rank(plotvar), nclr, labels=FALSE)
colcode <- plotclr[colornum] # assign color

# scatter plot
plot.angle <- 225
scatterplot3d(tann, pann, lat, type="h", angle=plot.angle, color=colcode,
pch=20, cex.symbols=2, col.axis="gray", col.grid="gray")

par <- oldpar