Re: [R] Conditional polygon colouring

2014-02-28 Thread David Carlson
age- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of mamuash bukana Sent: Friday, February 28, 2014 9:11 AM To: r-help@r-project.org Subject: [R] Conditional polygon colouring Dear R users I want to paint parts of a polygon with different colours conditional

[R] Conditional polygon colouring

2014-02-28 Thread mamuash bukana
Dear R users I want to paint parts of a polygon with different colours conditional to values of the variable. Example: f<-seq(1,33) g<-sin(f) i<-rep(0,33) ff<-c(f,rev(f)) gg<-c(g,rev(i)) plot(ff,gg,type="n") polygon(ff,gg,col=2) # but I wanted to plot areas below and above the x-axis with diff