[R] rotate text using mtext
Chuck Cleland
ccleland at optonline.net
Tue Jun 27 21:22:28 CEST 2006
Rashmi Mathur wrote:
> Hello,
>
> I wish to write a label to the right-hand side of a plot (side=4) using
> mtext, with the text facing inwards - that is, rotated 180 degrees from the
> default orientation. How might I do this? (I've tried experimenting with
> las but no luck.)
Use text() instead. I'm not sure how you want the label oriented,
but this should get you started:
df <- data.frame(cbind(1:10, 11:20))
names(df) <- c("y","x")
par(mar = c(7, 7, 7, 10))
plot(y ~ x, data = df, ylab = "", xlab = "independent")
text(par("usr")[2] + 0.25, 5.5, srt=-45, adj = 0, labels = "dependent",
xpd = TRUE)
> Thanks,
> Rashmi
>
>
> Rashmi Mathur
> Master's Candidate
> Fisheries Science and Management Research Group
> School of Resource and Environmental Management (REM)
> Simon Fraser University
> Burnaby, BC
> rashmim at sfu.ca
> http://www.rem.sfu.ca/fishgrp
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894
More information about the R-help
mailing list