[R] labels on right y-axis

2013-12-12 Thread Fisher Dennis
OS X
R 3.0.2

Colleagues,

I am displaying two sets of values changing over time; as a result, I have two 
y-axes.  I add a label for the right-side Y axis with mtext(side=3, line=1.2, 
TEXT).  The text is parallel to the axis -- so far, so good.  However, the text 
is rotated counterclockwise from horizontal, whereas I would like it rotated 
clockwise.

Neither srt nor las fixes this.  I guess that one convoluted approach would be 
to use text rather than mtext.  However, positioning would be a nuisance 
and the xpd option would be needed.  Is there any simpler approach?

Dennis 


Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com




[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] labels on right y-axis

2013-12-12 Thread David Carlson
I don't see an alternative to text(), but the positioning is not
that difficult:

oldpar - par(mar=c(5.1, 4.1, 4.1, 4.1))
plot(0)
axis(4)
text(par(usr)[2], mean(par(usr)[3:4]), TEXT, 
 srt=-90, adj=c(.5,-4), xpd=TRUE)
par(oldpar)

-
David L Carlson
Department of Anthropology
Texas AM University
College Station, TX 77840-4352

-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Fisher Dennis
Sent: Thursday, December 12, 2013 8:32 AM
To: r-h...@stat.math.ethz.ch
Subject: [R] labels on right y-axis

OS X
R 3.0.2

Colleagues,

I am displaying two sets of values changing over time; as a
result, I have two y-axes.  I add a label for the right-side Y
axis with mtext(side=3, line=1.2, TEXT).  The text is parallel
to the axis -- so far, so good.  However, the text is rotated
counterclockwise from horizontal, whereas I would like it
rotated clockwise.

Neither srt nor las fixes this.  I guess that one convoluted
approach would be to use text rather than mtext.  However,
positioning would be a nuisance and the xpd option would be
needed.  Is there any simpler approach?

Dennis 


Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com




[[alternative HTML version deleted]]

__
R-help@r-project.org 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.

__
R-help@r-project.org 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.


Re: [R] labels on right y-axis

2013-12-12 Thread Bert Gunter
Might axis() be useful here?

?axis

Cheers,
Bert

On Thu, Dec 12, 2013 at 8:02 AM, David Carlson dcarl...@tamu.edu wrote:
 I don't see an alternative to text(), but the positioning is not
 that difficult:

 oldpar - par(mar=c(5.1, 4.1, 4.1, 4.1))
 plot(0)
 axis(4)
 text(par(usr)[2], mean(par(usr)[3:4]), TEXT,
  srt=-90, adj=c(.5,-4), xpd=TRUE)
 par(oldpar)

 -
 David L Carlson
 Department of Anthropology
 Texas AM University
 College Station, TX 77840-4352

 -Original Message-
 From: r-help-boun...@r-project.org
 [mailto:r-help-boun...@r-project.org] On Behalf Of Fisher Dennis
 Sent: Thursday, December 12, 2013 8:32 AM
 To: r-h...@stat.math.ethz.ch
 Subject: [R] labels on right y-axis

 OS X
 R 3.0.2

 Colleagues,

 I am displaying two sets of values changing over time; as a
 result, I have two y-axes.  I add a label for the right-side Y
 axis with mtext(side=3, line=1.2, TEXT).  The text is parallel
 to the axis -- so far, so good.  However, the text is rotated
 counterclockwise from horizontal, whereas I would like it
 rotated clockwise.

 Neither srt nor las fixes this.  I guess that one convoluted
 approach would be to use text rather than mtext.  However,
 positioning would be a nuisance and the xpd option would be
 needed.  Is there any simpler approach?

 Dennis


 Dennis Fisher MD
 P  (The P Less Than Company)
 Phone: 1-866-PLessThan (1-866-753-7784)
 Fax: 1-866-PLessThan (1-866-753-7784)
 www.PLessThan.com




 [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.

 __
 R-help@r-project.org 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

(650) 467-7374

__
R-help@r-project.org 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.


Re: [R] labels on right y-axis

2013-12-12 Thread Jim Lemon

On 12/13/2013 01:32 AM, Fisher Dennis wrote:

OS X
R 3.0.2

Colleagues,

I am displaying two sets of values changing over time; as a result, I have two 
y-axes.  I add a label for the right-side Y axis with mtext(side=3, line=1.2, 
TEXT).  The text is parallel to the axis -- so far, so good.  However, the text 
is rotated counterclockwise from horizontal, whereas I would like it rotated 
clockwise.

Neither srt nor las fixes this.  I guess that one convoluted approach would be to use 
text rather than mtext.  However, positioning would be a nuisance and the 
xpd option would be needed.  Is there any simpler approach?

Dennis


Hi Dennis,
This sounds like a job for twoord.plot (plotrix). I think I can leave 
the warnings, disclaimers and miscellaneous dissuasion to others.


Jim

__
R-help@r-project.org 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.