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?

Thanks,
Mohsen



pdf('Test.pdf')
BL<-c(1.97,8.04,2.54,10.53,4.85,1.73)
LR<-c(0.85,0.86,8.33,04.18,6.26,2.40)
 Q<-c(0.00,0.00,1.92,01.92,4.48,0.00)
cols <- ifelse(Q!=0, "orange", "green")
Graph<- barplot(LR, col=cols, width=(BL))
axis(1)

	[[alternative HTML version deleted]]

