Replot points with specific colors for below and above: > points(x[above2], data[above2], pch=20, col="red") > points(x[below_2],data[below_2],pch=20, col="blue") plot remarks Points above 2 are colored red. Points in the middle were not changed Points less than are colored –2 blue Plotting symbols Here is a table of many available symbols as described in E. Paradis’s manual for beginners” (English version, page 44. See credentials “R above.) You can try the following example code that all 25 symbols that can be used to produce points in graphs: # Make an empty chart plot(1, 1, xlim=c(1,5.5), ylim=c(0,7), type="n", ann=FALSE) # Plot digits 0-4 with increasing size and color text(1:5, rep(6,5), labels=c(0:4), cex=1:5, col=1:5) # Plot symbols 0-4 with increasing size and color points(1:5, rep(5,5), cex=1:5, col=1:5, pch=0:4) text((1:5)+0.4, rep(5,5), cex=0.6, (0:4)) # Plot symbols 5-9 with labels points(1:5, rep(4,5), cex=2, pch=(5:9)) text((1:5)+0.4, rep(4,5), cex=0.6, (5:9)) # Plot symbols 10-14 with labels points(1:5, rep(3,5), cex=2, pch=(10:14)) text((1:5)+0.4, rep(3,5), cex=0.6, (10:14))
Replot points with specific colors for below and above: > points(x[above2], data[above2], pch=20, col="red") > points(x[below_2],data[below_2],pch=20, col="blue") plot remarks Points above 2 are colored red. Points in the middle were not changed Points less than –2 are colored blue Plotting symbols Here is a table of many available symbols as described in E. Paradis’s manual “R for beginners” (English version, page 44. See credentials above.) You can try the following example code that all 25 symbols that can be used to produce points in graphs: # Make an empty chart plot(1, 1, xlim=c(1,5.5), ylim=c(0,7), type="n", ann=FALSE) # Plot digits 0-4 with increasing size and color text(1:5, rep(6,5), labels=c(0:4), cex=1:5, col=1:5) # Plot symbols 0-4 with increasing size and color points(1:5, rep(5,5), cex=1:5, col=1:5, pch=0:4) text((1:5)+0.4, rep(5,5), cex=0.6, (0:4)) # Plot symbols 5-9 with labels points(1:5, rep(4,5), cex=2, pch=(5:9)) text((1:5)+0.4, rep(4,5), cex=0.6, (5:9)) # Plot symbols 10-14 with labels points(1:5, rep(3,5), cex=2, pch=(10:14)) text((1:5)+0.4, rep(3,5), cex=0.6, (10:14))