[R] Rotating characters in text

David L Carlson dcarlson at tamu.edu
Wed Jun 13 16:18:12 CEST 2012


Or for the y label and using gsub:

plot(1:5, ylab="")
text(.35,3, gsub("(.)", "\\1\n", "Like this"), xpd=TRUE)

Sticking it in ylab= does not work.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Jim Lemon
> Sent: Wednesday, June 13, 2012 5:02 AM
> To: s.rosen at ucl.ac.uk
> Cc: r-help at r-project.org
> Subject: Re: [R] Rotating characters in text
> 
> On 06/12/2012 11:49 PM, Stuart Rosen wrote:
> > For labelling a plot, I am trying to rotate a character string using
> > text() so that characters are upright and reading down, for example,
> ...
> >
> > L
> > i
> > k
> > e
> >
> > t
> > h
> > i
> > s
> > .
> >
> > It appears that par crt does not work with text. Does anyone have any
> > other suggestions. Thanks!
> >
> Hi Stuart,
> Is this what you want?
> 
> plot(1:5)
> text(3,3,"L\ni\nk\ne\n\nt\nh\ni\ns\n")
> 
> Jim
> 
> ______________________________________________
> 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.



More information about the R-help mailing list