I want to plot a line chart. Depending on values it should change its color. What I found is:
plot(sin(seq(from=1, to=10,by=0.1)),type=\"p\", col=ife
Here is a little different approach:
x <- seq(from=1, to=10, by=0.1) plot(x,sin(x), col='red', type='l') clip(1,10,-1,.5) lines(x,sin(x), col='yellow', type='l')
Note that with this method the curve changes colors at exactly 0.5.