Skip to content
Prev 294154 / 398503 Next

additional axis, different scale

I don't think there is any other way.  On the other hand, most gurus suggest that a dual scales on a graph are not a good thing.

What about using a two panel graph?

Quick rejigging of your code :
=================================================================
a  <- c(10, 20, 30, 40)
b  <- c(50, 250, 500, 600)
ba <- b/a

op  <-  par(las=1, mar=c(5,5,.5,5), mfrow=c(2, 1))
plot(a,b,     type="b", pch=22, cex=2, col=4, lwd=2, ylim=c(0,650),
xlim=c(0,45))
 plot (a,ba, type="b", pch=21, cex=2, col=2, lwd=2, lty=1)
par(op)
==================================================================



John Kane
Kingston ON Canada
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM?, MSN? Messenger, Yahoo!? Messenger, ICQ?, Google Talk? and most webmails