[R] BarPlot Color

From: Mohsen Jafarikia <jafarikia_at_gmail.com>
Date: Tue 17 Oct 2006 - 00:25:26 GMT

Hello everyone,

In the following program, I have specified if 'Q!=0', bar color is 'orange' and if is '0.0', color is green. Now I want to have different colors for 'Q'. For example:

If 'Q=0.0' then color is green
If 'Q=1.92' then color is blue
If 'Q=4.48' then color is red

I also want an indicator in the bottom of the graph which tells me what is every color.

 Can anybody tell me how I can do this?




cols <- ifelse(Q!=0, "orange", "green")
Graph<- barplot(LR, col=cols, width=(BL)) axis(1)

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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. Received on Tue Oct 17 10:37:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 17 Oct 2006 - 01:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.