I am trying to add names to the columns of my line chart ... In each group there are 2 bars that will have the same name.
I am using code like this:
l<-c(.6286, .2212, .9961, .5831, .8703, .6990, .9952, .9948) r<-c(.2721, .5663, .0, .3961, .0696, .1180, .0, .0) tab<-rbind(l,r) plot<-barplot(tab, beside=TRUE, axisnames=FALSE, main = 'Time Spent Left vs. Right', sub = 'Female 2c', xlab= 'Days After Entry', ylab = 'Proportion of Time Spent', col=c('blue', 'red'), ylim = c(0,1)) legend('topleft', .8, c('Left' , 'Right'), pch=c(.8), col=c('blue', 'red')) names.arg = jd2c$d.in.p names.arg=c(3,4,5,6,6,7,10,11)
jd2c $ d.in.p is also listed above .. For some reason, the names.arg function does not seem to do what I expect. Even if I put it in the parenthesis of the bar plot () function.
What am I doing wrong?
Thanks!
Ross D.
source share