[R] labels on right y-axis

Bert Gunter gunter.berton at gene.com
Thu Dec 12 17:12:26 CET 2013


Might axis() be useful here?

?axis

Cheers,
Bert

On Thu, Dec 12, 2013 at 8:02 AM, David Carlson <dcarlson at 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 A&M University
> College Station, TX 77840-4352
>
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Fisher Dennis
> Sent: Thursday, December 12, 2013 8:32 AM
> To: r-help at 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 at 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 at 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



More information about the R-help mailing list