What's wrong? I tried today's examples and just got only both labels printed one over the other. 1. Brian Ripley x <- 1:10 y <- rnorm(10) z <- runif(10, 1000, 10000) par(mar=c(5,4,4,4) + 0.1) # Leave space for z axis plot(x, y) par(new=T) plot(x, z, type="l", axes=F, bty="n", xlab="", ylab="") axis(4, at=pretty(range(z))) mtext(z, 4, 3) 2. Don MacQueen x <- 1:5 y1 <- 1:5 y2 <- 25:21 plot(x,y1) par(new=T) plot(x,y2,yaxt='n',col='blue') axis(4,y2) platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 major 1 minor 5.0 year 2002 month 04 day 29 Helmut Sch?tz Biometrics Dep. Biokinet GmbH Nattergasse 4 A-1170 Vienna/Austria tel +43(0)1 4856969-77 fax +43(0)1 4856970-90 helmut.schuetz at chello.at -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Different y-axes
4 messages · Brian Ripley, Peter Dalgaard, Helmut Schütz
On Tue, 18 Jun 2002, Helmut [iso-8859-1] Schütz wrote:
What's wrong?
You tell us: we don't know what you are seeing ....
I tried today's examples and just got only both labels printed one over the other. 1. Brian Ripley x <- 1:10 y <- rnorm(10) z <- runif(10, 1000, 10000) par(mar=c(5,4,4,4) + 0.1) # Leave space for z axis plot(x, y) par(new=T) plot(x, z, type="l", axes=F, bty="n", xlab="", ylab="") axis(4, at=pretty(range(z))) mtext(z, 4, 3)
^
mtext("z", 4, 3) was a copying error from me, but all the rest works.
2. Don MacQueen x <- 1:5 y1 <- 1:5 y2 <- 25:21 plot(x,y1) par(new=T) plot(x,y2,yaxt='n',col='blue') axis(4,y2)
That does plot the box, x axis and x label twice, which matters on some devices, e.g. a plotter.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Helmut Sch?tz <helmut.schuetz at chello.at> writes:
What's wrong? I tried today's examples and just got only both labels printed one over the other. 1. Brian Ripley x <- 1:10 y <- rnorm(10) z <- runif(10, 1000, 10000) par(mar=c(5,4,4,4) + 0.1) # Leave space for z axis plot(x, y) par(new=T) plot(x, z, type="l", axes=F, bty="n", xlab="", ylab="") axis(4, at=pretty(range(z))) mtext(z, 4, 3)
This is fine if you leave out the last line... Did that really come
from Brian?? mtext("z", 4, 3) might have been the intention.
2. Don MacQueen x <- 1:5 y1 <- 1:5 y2 <- 25:21 plot(x,y1) par(new=T) plot(x,y2,yaxt='n',col='blue') axis(4,y2)
you need at least ylab="" on the 2nd plot.
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley schrieb:
On Tue, 18 Jun 2002, Helmut [iso-8859-1] Sch?tz wrote:
What's wrong?
You tell us: we don't know what you are seeing ....
I tried today's examples and just got only both labels printed one over the other. 1. Brian Ripley x <- 1:10 y <- rnorm(10) z <- runif(10, 1000, 10000) par(mar=c(5,4,4,4) + 0.1) # Leave space for z axis plot(x, y) par(new=T) plot(x, z, type="l", axes=F, bty="n", xlab="", ylab="") axis(4, at=pretty(range(z))) mtext(z, 4, 3)
^
mtext("z", 4, 3) was a copying error from me, but all the rest works.
by now it works, thanks a lot!
2. Don MacQueen x <- 1:5 y1 <- 1:5 y2 <- 25:21 plot(x,y1) par(new=T) plot(x,y2,yaxt='n',col='blue') axis(4,y2)
That does plot the box, x axis and x label twice, which matters on some devices, e.g. a plotter.
true, but it was given as an example of "double" y-labels; maybe I just misunderstood the intention.
-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._