Mohsen Jafarikia <jafarikia <at> gmail.com> writes: > > Hello everyone, > > I want to use 'angle' in Bar Plot with different angles for different bars. > > For example if the 3th column of the following data is '0.0', I want the > angle to be '45' degrees, if it is '1.92', I want '65' and
[snip] couldn't read the end of your e-mail but chose to set angle=80 for the third value ... z <- matrix(c(3.74,0,6.12,1.92,9.71,0,1.32,1.92,8.24,4.48),byrow=TRUE, + ncol=2) > z [,1] [,2] [1,] 3.74 0.00 [2,] 6.12 1.92 [3,] 9.71 0.00 [4,] 1.32 1.92 [5,] 8.24 4.48 > barplot(z[,1],angle=c(45,65,80)[as.numeric(factor(z[,2]))],density=5) I will point out that this is pretty ugly though ... Ben Bolker ______________________________________________ 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.