PLT <- function(frq,fs1,fs2,strn){ plot( 0,0.1, log="y", type="n", xlim=c(0,20), ylim=c(0.1,10000), xlab="Frequency (Hz)", ylab="Fourier spectrum (gal * sec)", axes=FALSE ) cc<-seq(1,9,by=1) c1<-c(0,5,10,15,20) c2<-c(cc*0.1,cc*1,cc*10,cc*100,cc*1000,10000) abline(v=c1,col="gray") abline(h=c2,col="gray") axis(1,c(0,5,10,15,20)) axis(2,c(0.1,1,10,100,1000,10000),c("0.1","1","10","100","1000","10000")) box() lines(frq,fs1,lwd=1,col="red") lines(frq,fs2,lwd=2,col="black") mtext(text=strn,side=3,line=0,adj=0) legend( "bottomleft", c("Original","Parzen (1Hz)"), col = c("red","black"), lty = c(1,1), lwd = c(1,2), bg = "white" ) } for(iii in 1:3){ if(iii==1)fnameR="dat_fsp_1.txt" if(iii==2)fnameR="dat_fsp_2.txt" if(iii==3)fnameR="dat_fsp_3.txt" if(iii==1)strn="TCGH16_EW2" if(iii==2)strn="TCGH16_NS2" if(iii==3)strn="TCGH16_UD2" if(iii==1)fnameF="fig_R_fsp_1.eps" if(iii==2)fnameF="fig_R_fsp_2.eps" if(iii==3)fnameF="fig_R_fsp_3.eps" d<-read.table(fnameR,skip=1) postscript(file=fnameF,width=10,family="Helvetica") par(ps=18) PLT(d[,1],d[,2],d[,3],strn) dev.off() }