You can pass a vector of ticks to the axis() function that expand the actual range,
par(mar=c(5.1,4.1,4.1,5.1)) plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') par(new = TRUE) plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col= 'green') ##axis(4, col='green') axis(4, at=seq(0,12,2), col='green') mtext(side=4, text="label green", line=2) par(new = TRUE) plot(x$Time, x$y3, type = 'l', axes = FALSE, xlab = '', ylab = '', col = 'blue') ##axis(4, col='blue', line = -4) axis(4, at=seq(0,0.12,0.02), col='blue', line = -4) mtext(side=4, text="label green", line=-2) ti <- axTicks(4) ti.delta <- diff(ti)[1] ti.expan <- seq(ti[1]-ti.delta, ti[length(ti)]+ti.delta, ti.delta) ti.expan axis(4, at=ti.expan, col='blue', line=-8) Walmes. ========================================================================== Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) Departamento de Estatística - Universidade Federal do Paraná fone: (+55) 41 3361 3573 VoIP: (3361 3600) 1053 1173 e-mail: wal...@ufpr.br twitter: @walmeszeviani homepage: http://www.leg.ufpr.br/~walmes linux user number: 531218 ========================================================================== On Thu, May 26, 2011 at 5:22 PM, Jun Shen <jun.shen...@gmail.com> wrote: > Thanks a bunch, Walmes. > > One more concern, the new Y axes added do not extend all the way down to > cross with x axis. Is there anyway to make them look like the very first Y > axis on the left? > > Jun > > On Thu, May 26, 2011 at 1:24 PM, Walmes Zeviani > <walmeszevi...@gmail.com>wrote: > >> You can use mtext() >> >> par(mar=c(5.1,4.1,4.1,5.1)) >> plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') >> par(new = TRUE) >> plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col= >> 'green') >> axis(4, col='green') >> mtext(side=4, text="label green", line=2) >> par(new = TRUE) >> plot(x$Time, x$y3, type = 'l', axes = FALSE, xlab = '', ylab = '', col = >> 'blue') >> axis(4, col='blue', line = -4) >> mtext(side=4, text="label green", line=-2) >> >> Walmes. >> >> ========================================================================== >> Walmes Marques Zeviani >> LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) >> Departamento de Estatística - Universidade Federal do Paraná >> fone: (+55) 41 3361 3573 >> VoIP: (3361 3600) 1053 1173 >> e-mail: wal...@ufpr.br >> twitter: @walmeszeviani >> homepage: http://www.leg.ufpr.br/~walmes >> linux user number: 531218 >> ========================================================================== >> >> [[alternative HTML version deleted]] >> >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> > [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.