[R] labels on secondary y axis

Patrick Connolly p.connolly at hortresearch.co.nz
Thu Aug 26 03:26:17 CEST 2004

On Thu, 26-Aug-2004 at 01:34AM +0100, Louize Hill wrote:

|> Hi,
|> I have plotted a graph and used a secondary axis as follows:
|> plot (d$Year, d$HrFishing, type='l', col='1', xlab='Year', ylab='Effort
|> (hours/fishing)')
|> par(new=TRUE)
|> plot (d$Year, d$Landings, type='l', col='3', xlab='', ylab='')
|> axis(4)
|> However, if I put a label in the 2nd ylab='' it is placed over the 1st ylab,
|> on the left hand side.
|> Clearly label in the axis command is not what I want as that erases my tick
|> marks, and ylab generates errors here!
|> Please can someone give me a pointer on what I should be using.

mtext is your friend.

Patrick Connolly
Mt Albert
New Zealand 
Ph: +64-9 815 4200 x 7188
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 

More information about the R-help mailing list