Skip to content
Prev 257272 / 398506 Next

Alignment of lines within barplot bars

Sorry I took so long to get back on this, I have been out of town.

For your case you need to provide adjustments for both the x and y to updateusr, try this:

library(TeachingDemos)
tmp <- barplot(c(1.5,40),yaxt='n',names.arg=1:2,ylim=c(0,1.25*40))
axis(4)
tmp2 <- par('usr')
updateusr(tmp[1:2], tmp2[3:4], 1:2, c(0,0.022) )
points( 1:2, c(0.01, 0.02), pch=16 )
axis(2)


You can make further adjustments to the new y axis by changing the 0.022 in the updateusr call.