Perhaps something like this:

x <- sample(10:50, 10, rep=TRUE)
cols <- as.character(cut(x,
                                   breaks = c(0, 10, 20, 30,max(x)),
                                   labels = c("green", "blue", "yellow",
"red")))
barplot(x, col = cols)

On Mon, Jun 16, 2008 at 4:15 PM, <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I want to use R to produce nice meteograms...
>
> For this I would need to color-code my barplot according to the value
> plotted
>
> say if value x > 30 ... the bar is red ; if x between 20 and 10, the bar
> is blue etc...
>
> any ideas how to proceed ?
>
> Thank You a lot,
> maria
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to