rm(list=ls())
require(lattice)
# quartz(width=12, height=7.6)
# op <- par(mfrow = c(2, 3), pty = "m")       # square plotting region,
# layout(matrix(1:6, 2,3))
# skipi<-c(20, 159,298,439,578,717)   # 043
# skipi<-c(22, 161,300,451,590,729)   # 044
# skipi<-c(21, 160,299,439,578,717)   # 045
 skipi<-c(20, 159,298, 439,578,717)   # 049 = 043 skips
URL<-"http://www.bio.umass.edu/biology/kunkel/LabWiki/images/9/90/Chris049.txt"
# LIX<-'Chloride X-uV'
LIX<-'Cl uV'
Nam<-'Ch049'
filnam<-strsplit(URL,'/')
lfil<-length(filnam[[1]])
filnam<-filnam[[1]][lfil]
for(i in 1:6) { skiplin<-skipi[i]
XX<-read.csv(URL, skip=skiplin, nrows=121)
attach(XX)
quartz()
# print(names(XX))
# mVav<-(DiffCl1_1_mV + DiffCl1_2_mV + DiffCl1_2_mV)/3    # Cl
# mVav<-(DiffH1_1_mV + DiffH1_2_mV + DiffH1_2_mV)/3    # H
opar=par(mar=c(5,4,4,2)+0.1)
Y<- Y_microns +50
Z<- Z_microns +50
W<- Z-Y/20
IW<-sort(W, index.return=TRUE)
IW<-IW$ix
CluV<-matrix(Avg_xgradCl_uV[IW],11,11)
# contourplot(ClXuV)
# The XuV goes from -500 to 10,000 in the 3 graphs.
filled.contour(CluV, 
              main=paste(Nam, LIX, 'skip', skiplin, 'Hrs from =', Hrs_From[1]),
              zlim=c(-600,6500), 
              color.palette = rainbow) 
  #           zlim=c(-600,6500), 
detach(XX)
              }