[R] Rotating characters in text

baptiste auguie baptiste.auguie at googlemail.com
Tue Jun 12 22:22:14 CEST 2012


Try this,


rotate = function(x) paste(strsplit(x,"")[[1]],collapse="\n")

t <- "this is a text"
plot.new()
text(1/2,1/2,t)
par(lheight=0.8)
text(1/2,1/2,rotate(t))


HTH,

b.
On 13 June 2012 01:49, Stuart Rosen <s.rosen at ucl.ac.uk> 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!
>
> Yours - Stuart Rosen
>
> ______________________________________________
> 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