Re: [R] Plot using colors

2008-03-03 Thread hadley wickham
On Mon, Mar 3, 2008 at 4:03 AM, mysimbaa <[EMAIL PROTECTED]> wrote: > > Dear R users, > I have a problem since I try to plot my datas with different colors. > > plot(tvar, var, xlab="zeit [s]",ylab="Variation [%]", col = ifelse(var <= > varstability, 'green','red')) > this works well! > > Bu

Re: [R] Plot using colors

2008-03-03 Thread Henrique Dallazuanna
You want just the points with colors? var <- rnorm(10) vars <- rnorm(10) plot(var, type='l') points(var, col=ifelse(var < vars, 'green', 'red'), pch= 16) or the lines also? for(i in 1:9)segments(i, var[i], i + 1, var[i+1], ifelse(var[i] < vars[i], 'green', 'red')) On 03/03/2008, mysimbaa <[E

Re: [R] Plot using colors

2008-03-03 Thread Hans Ekbrand
On Mon, Mar 03, 2008 at 02:03:07AM -0800, mysimbaa wrote: > > Dear R users, > I have a problem since I try to plot my datas with different colors. > > plot(tvar, var, xlab="zeit [s]",ylab="Variation [%]", col = ifelse(var <= > varstability, 'green','red')) > this works well! > > But since I add

[R] Plot using colors

2008-03-03 Thread mysimbaa
Dear R users, I have a problem since I try to plot my datas with different colors. plot(tvar, var, xlab="zeit [s]",ylab="Variation [%]", col = ifelse(var <= varstability, 'green','red')) this works well! But since I add a type="l" to my plot, it will color all the plot with green!!! Is there an