Re: [R] plot axises on both sides of a graph

From: JeeBee <JeeBee_at_troefpunt.nl>
Date: Wed 06 Sep 2006 - 10:44:05 GMT

Look at:
?axis (try the examples)

Further, a nice example I found on this mailing lists archive, from somebody who says this has been asked many times already :)

x <- 1:10
y1 <- 1:10
y2 <- rev(seq(1,1000, length=10))
plot(x,y1,ann=FALSE)
axis(2, at=c(2,4,6,8), labels=as.character(c(2,4,6,8)))

points(x,y2/100,col="red")
axis(4, at=c(2,4,6,8), labels=as.character(c(200, 400, 600, 800)))

On Wed, 06 Sep 2006 18:10:33 +0800, gallon li wrote:

> Usually the y-axis is shown on the left-hand-side of a graph, is it
> possible to artifically creat one more y-axis on the right-hand-side in R?
> What is the main reference? Thank you in advance.
>

> [[alternative HTML version deleted]]
>
> ______________________________________________ R-help@stat.math.ethz.ch
> 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.



R-help@stat.math.ethz.ch 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. Received on Wed Sep 06 20:47:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.