Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to plot mirror-flipped text in R?

Tags:

r

I know that there is str argument in the text function; it would be nice for me to be able to plot the the mirrored letters / strings too... Any idea?

like image 336
Martin Hroch Avatar asked Sep 28 '14 16:09

Martin Hroch


1 Answers

You could play with grImport, but it's rather convoluted

enter image description here

library(grImport)

cat("%!PS 
 /Times-Roman findfont 
 100 scalefont 
 setfont 
 newpath 
 0 0 moveto 
 -1 1 scale
 (hello) show", file="hello.ps")

PostScriptTrace("hello.ps", "hello.xml")
hello <- readPicture("hello.xml")
grid.newpage()
grid.picture(hello)
like image 97
baptiste Avatar answered Sep 27 '22 22:09

baptiste