# # EPage 453 # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- # Ex 12.1: # DF = read.csv( "../../Data/CH12/ex12-01.txt", header=TRUE, quote="'" ) stem(DF$Temp) stem(DF$Ratio) #postscript("../../WriteUp/Graphics/Chapter12/chap_12_ex_1_scatter_plot.eps", onefile=FALSE, horizontal=FALSE) plot( DF$Temp, DF$Ratio ) #dev.off() # Ex 12.2: # DF = read.csv( "../../Data/CH12/ex12-02.txt", header=TRUE, quote="'" ) #postscript("../../WriteUp/Graphics/Chapter12/chap_12_ex_2_scatter_plot.eps", onefile=FALSE, horizontal=FALSE) plot( DF$Age, DF$Baseline ) #dev.off() # Ex 12.3: # DF = read.csv( "../../Data/CH12/ex12-03.txt", header=TRUE, quote="'" ) plot( DF$x, DF$y ) # Ex 12.4: # DF = read.csv( "../../Data/CH12/ex12-04.txt", header=TRUE, quote="'" ) #postscript("../../WriteUp/Graphics/Chapter12/chap_12_ex_4_boxplot.eps", onefile=FALSE, horizontal=FALSE) boxplot( DF ) #dev.off() #postscript("../../WriteUp/Graphics/Chapter12/chap_12_ex_4_scatter_plot.eps", onefile=FALSE, horizontal=FALSE) plot( DF$x, DF$y, xlab="BOD mass loading", ylab="BOD mass removed" ) abline(a=0,b=1) #dev.off() # Ex 12.5: # DF = read.csv( "../../Data/CH12/ex12-05.txt", header=TRUE, quote="'" ) #postscript("../../WriteUp/Graphics/Chapter12/chap_12_ex_5_scatter_plot_0_0.eps", onefile=FALSE, horizontal=FALSE) plot( DF$x, DF$y, xlim=c(0,90), ylim=c(0,250), main="axes intersecting at (0,0)", xlab="temperature", ylab="elongation" ) abline(v=c(0,20,40,60,80,100),col="gray") abline(h=c(0,50,100,150,200,250),col="gray") #dev.off() postscript("../../WriteUp/Graphics/Chapter12/chap_12_ex_5_scatter_plot_55_100.eps", onefile=FALSE, horizontal=FALSE) plot( DF$x, DF$y, xlim=c(55,90), ylim=c(100,250), main="axes intersect at (55,100)" ) abline(v=c(0,20,40,60,80,100),col="gray") abline(h=c(0,50,100,150,200,250),col="gray") dev.off()