问题
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
回答1:
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.
回答2:
?text3d
There is no cex argument. You should be using "scale".
来源:https://stackoverflow.com/questions/9214298/cannot-change-text-size-in-rgl-plot