Enhanced 2-D Scatter plots
The scatter diagram or scatter plot is the workhorse bivariate plot, and can be enhanced to illustrate relationships among three (or four) variables.
Color plot
Displays the values of three variables at a time using colored symbols, where the value of one variable determines the relative position of the symbol along the X-axis and the value of a second variable determines the relative position of the symbol along the Y-axis, and the value of the third variable is used to determine the color of the symbol.
The Specmap data set illustrated the variations over time of oxygen-isotope data (that records global ice volume) which should theoretically depend on insolation. However, a simple plot of Insolation and O18 (and correlation) suggests otherwise:
attach(specmap)
plot(O18 ~ Insol)
cor(O18, Insol)
Plotting O18 as a function of Age, and color coding the symbols by Insol levels, reveals the nature of the control of ice volume by insolation:
library(RColorBrewer)
library(classInt)
plotvar <- Insol
nclr <- 8
plotclr <- brewer.pal(nclr,"PuOr")
plotclr <- plotclr[nclr:1] # reorder colors
class <- classIntervals(plotvar, nclr, style="quantile")
colcode <- findColours(class, plotclr)
plot(O18 ~ Age, ylim=c(2.5,-2.5), type="l")
points(O18 ~ Age, pch=16, col=colcode, cex=1.5)
Information from four variables at a time can also be displayed. In this example for the Summit Cr. data, the plotting character is determined by Reach and its color by HU. Although these are factors, numerical variables could also be plotted.
attach(sumcr)
plot(WidthWS ~ CumLen, pch=as.integer(Reach), col=as.integer(HU))
Bubble plot
Displays the values of three variables at a time using graduated symbols (usually circles), where the value of one variable determines the relative position of the symbol along the X-axis and the value of a second variable determines the relative position of the symbol along the Y-axis, and the value of the third variable is used to determine the size of the symbol.
attach(orstationc)
plot(lon, lat, type="n")
symbols(lon, lat, circles=elev, inches=0.1, add=T)