Re: [R] plot with different color

2006-06-05 Thread Jim Lemon
array chip wrote: > Hi how can I plot a series of number as a line, but > with lines above a threshould as one color, and with > lines below the threshold as another color. for > example, a numeric vector: rnorm(1:100), and plot > these numbers in the original order, but lines above > the horizonta

Re: [R] plot with different color

2006-06-02 Thread P Ehlers
Greg, It might be better to use ylim = c(min(x), 0) in place of ylim = c(-4, 0). I don't think plt can take negative values. Peter Ehlers Greg Snow wrote: > Here is one approach. It uses the function clipplot which is shown > below (someday I will add this to my TeachingDemos package, the > Te

Re: [R] plot with different color

2006-06-02 Thread Greg Snow
par(plt=c(pc$x,pc$y),xpd=FALSE) fun par(old.par) box() # need to plot something to reset } -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED

[R] plot with different color

2006-06-02 Thread array chip
Hi how can I plot a series of number as a line, but with lines above a threshould as one color, and with lines below the threshold as another color. for example, a numeric vector: rnorm(1:100), and plot these numbers in the original order, but lines above the horizontal line at 0 are in red, and li