[R] How to change color of bar based on y value of y axis?

Manish Gupta mandecent.gupta at gmail.com
Wed Apr 18 05:52:14 CEST 2012


Hi, 


I m working on bar chart. 

*Input file:*
index	-5	1
index	-4	3
index	-3	2
index	-2	10
index	-1	7
index	0	2
index	1	1

barplot(t(as.matrix(i[3])), ylab= "value", main = "testdata", beside=TRUE,
col=c("burlywood1"),horiz=TRUE,cex.names=0.8,names.arg=t(as.matrix(i[,2])))

But i need to change the color of bar where value of  y = -3 dynamically.
How can i implement it. 

Regards http://r.789695.n4.nabble.com/file/n4566636/Screenshot.png 

--
View this message in context: http://r.789695.n4.nabble.com/How-to-change-color-of-bar-based-on-y-value-of-y-axis-tp4566636p4566636.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list