Greetings – 

 

Grateful for any help on this one:

 

In the following demo code, I am trying to get the points in the line to
appear over the same x-axis labels as are used by the paired Bars.  It
appears, however, that R/lattice ignores the x-axis points used by the bars
and plots the x points for the line at ½ points.

 

Can you help me tweak this code so that the nth bump in the line appears
over the same nth pair of bars?  I’m open to any options besides
lattice/barplot. 

 

library(lattice)

aa <- abs(rnorm(c(1:10)))*5

bb <- abs(rnorm(c(1:10)))*5

cc <- abs(rnorm(c(1:10)))*5

 

dd <- as.matrix(cbind(aa, bb))

 

barplot(t(dd), beside=TRUE, ylim=c(0,10))

lines(cc)

 

Many thanks,

 

Galen


	[[alternative HTML version deleted]]

