Skip to content
Prev 297219 / 398498 Next

Rotating characters in text

Hello,

(You forgot to unlist() the result of strsplit.)

Another way, saving some space between characters is to use strheight().


rotate90 <- function(x, y, label){
	label <- unlist(strsplit(label, ''))
	y <- y - (seq_along(label) - 1)*strheight(label)
	list(x=x, y=y, label=label)
}

txt <- rotate90(5, 5, "Test rotate90")
plot(1:10)
text(txt$x, txt$y, txt$label)


Rui Barradas

Em 12-06-2012 21:02, Greg Snow escreveu: