Samstag, 20. April 2013

Second axis

Just a short snippet for a plot with 2 axes for demonstrating the technique.


b <- barplot(1:10, ylim=c(0,20))

par(new=TRUE)
plot(x=b, y=rep(60, 10), xlim=par("usr")[1:2], xaxs="i", yaxs="i"
     , frame.plot=FALSE, axes=FALSE, xlab="", ylab="", type="b", pch=15
     , ylim=c(0,80))

axis(side=4)



And the result: