[R] plotting 2 y axes

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Jun 26 18:13:03 CEST 2001


David White <dwhite at ling.ohio-state.edu> writes:

> Hello,
> 
> I'm plotting two y axes and have had good success using plot (specifying
> axes=F and ann=F) then adding the y axis to the right with axis(4...) and
> overlaying another plot (this time leaving the axis and labels in place.
> My difficulty lies in getting a label for the right-side y-axis.

By default there is only room for 2.1 lines of text on the right hand
side of a plot. The tick marks take one and the labels another and
there needs to be a blank line between labels and axis title....
I.e. you likely need to play with par(mar=) to get at least 4 lines
on that side. Also, axis() doesn't take
a ylab argument so try

 mtext("Heyho",side=4,line=3)

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



More information about the R-help mailing list