[R] Plotting with more than one y axis

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Mar 26 11:48:30 CEST 2001


Frank Gerrit Zoellner wrote:
> 
> Hi!
> 
> I want to combine two plots. On the one hand i've got a histogram and on the other hand a line plot. The y axis of the plot are different and i want both axis (one on the right side the other on the left side) in the plot. How can I do this in R ?

I would try something like:

hist(....., xlim=c(.....))
par(new=TRUE)
plot(....., xaxt="n", yaxt="n", xlim=c(.....))
axis(4)


Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list