Re: [R] Labelling a secondary axis in R

From: Duncan Murdoch <>
Date: Mon, 21 Apr 2008 10:09:14 -0400

On 4/21/2008 9:02 AM, Nakamura wrote:
> Hello,
> How can I label a secondary axis in R? At the moment it's labelled as
> c(-100,200). Obviously I would like it to be more sensible.
> Here is the code I am using
> newx = -100+37.5*((1:9)-1)
> axis(4,at=newx,labels=(newx+100)/3750)

I don't understand your question. When I run this code:

 > newx = -100+37.5*((1:9)-1)
 > plot(1:9, newx)
 > axis(4,at=newx,labels=(newx+100)/3750)

I get labels on side 4 which are 0, 0.01, ..., 0.08.

I think we need a complete example to see the problem.

Duncan Murdoch mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 21 Apr 2008 - 14:10:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Apr 2008 - 15:30:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive