mysimbaa wrote: > Hello Everybody, > I'm trying to plot(x,y) using different colors. > I have to cut (x,y) into sub intervals. > And I want to plot this sub intervals using colors. But infortunally I don't > know how to do this with R. > Can any body help me please? > > My code is looking like : > x<-c(tvar[1:t0],tvar[t0:(ts)],tvar[ts:n]) > F<-c(var[1:t0],var[t0:(ts)],var[ts:n]) > plot(x,F,xlab="Zeit [s]",ylab="Variation [%]",col = "red",type="l") > Hi Adel, Perhaps you would be interested in the color.scale.lines function in the plotrix package that allows one to color each defined segment of a line separately.
Jim ______________________________________________ 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.