4

I have a problem changing the text size of a 3d plot I generated with the package rgl. Everything works fine, but I can't effectively change the cex properties of an 3d object. I run R 2.14.1 (2011-12-22) under 64bit Ubuntu 10.04 LTS (2.6.32-37-generic). As an example see the following code (I found on Stack Overflow):

library(rgl) 
set.seed(1001) 
n <- 20 
text3d(runif(n),runif(n),runif(n),LETTERS[1:n],cex=seq(0.5,5,length=n))

The letters have all the same size when I plot them.

Any help is highly appreciated! Best Regards.

Frieder Schillinger

TwistTue
  • 41
  • 2

2 Answers2

2

Weird. It works for me on Ubuntu 10.04 (rgl 0.92.829) [this is my code, I think]. Can you tell us your rgl version? By "plot" do you mean rendering the picture on the screen, or producing PostScript output? This was fixed in the most recent (0.92.829) version:

> news(grepl("text",Text),package="rgl")
Changes in version 0.92.829:

    o   rgl.postscript() now adjusts the size of text following the cex setting.
       The font and family settings are still ignored.

    o   Transparency in material textures was not always rendered properly.
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Thanks for the prompt replies! And sorry for being imprecise: with “plot” I meant “rendering”. I installed the rgl package (version 0.89) via `sudo apt-get install r-cran-rgl` since I could not manage to install it directly in R (same error message as reported by other users, e.g. [link](http://r.789695.n4.nabble.com/package-ca-rgl-for-ubuntu-td3075070.html)). I also double-checked installing rgl (0.92.798) successfully in R on my laptop (also Ubuntu 10.04 LTS) and the code works! So I might try to tackle the problems I had in the first place installing rgl within R on my desktop PC. – TwistTue Feb 10 '12 at 11:02
0
?text3d

There is no cex argument. You should be using "scale".

IRTFM
  • 258,963
  • 21
  • 364
  • 487