Hi, I am trying to plot several columns in different graphs in columns and rows. The first column of my data file is the time, and the third is the 'elevation angle' with 19 different numbers. I would like to plot the rest of the columns with the x axis as time and the individual angles in different colours.
Here is the code I am using right now. It plots the different columns with time, but I didn't know how to make the third column as the colour filter. ------ maduplot<-function(mydata) { par(mfrow=c(5,3),mar=c(2,2,2,2)) for(i in 2:ncol(mydata)) { plot(mydata[,i]~mydata[,1] ,type="l" ,xlab=colnames(mydata)[1] ,ylab=colnames(mydata)[i] ,main=colnames(mydata)[i]) grid(col="black",lwd=0.2,lty=1) } } HCHO <-read.table("qdoas.qdo", header=TRUE) maduplot(HCHO) ------ A sample dataset is attached. http://r.789695.n4.nabble.com/file/n3275655/QDOAS.qdo QDOAS.qdo -- View this message in context: http://r.789695.n4.nabble.com/Plot-colour-according-to-column-tp3275655p3275655.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.