[R] plot axises on both sides of a graph

JeeBee JeeBee at troefpunt.nl
Wed Sep 6 12:44:05 CEST 2006


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 at 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.



More information about the R-help mailing list