Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rgl plot: point size does not change when saving as postscript

Tags:

r

rgl

I'm trying to generate a 3d scatterplot using rgl. It looks great on my screen, but whenever I export it as a PDF (or any other postscript format) it completely ignores any size specifications I use.

(I'm running RGui v.2.15.1 and rgl v.0.92.892 on a Macbook under Mountain Lion.)

For example:

library(rgl) 
set.seed(1982) 
points3d(runif(5),runif(5),runif(5), size=20)
# points look huge
rgl.postscript('testplot.pdf', fmt='pdf')
# points look tiny

Does anyone have an idea for a way to get this to work? The resolution of the images I get using rgl.snapshot don't look so good, and I would really like to get a vector image for this plot.

Also, I followed this thread and I got text to resize just fine, but not points. So I thought one way to work around this would be to plot my points as text using a circle as my character, but I couldn't get rgl to accept symbols or expressions either...

like image 390
Rafael Maia Avatar asked Oct 07 '22 06:10

Rafael Maia


1 Answers

Confirmed on Windows, look like some paper size scaling problem. You might try

spheres3d(runif(5),runif(5),runif(5),radius=0.1)

as a workaround if you can live with real 3d.

like image 88
Dieter Menne Avatar answered Oct 09 '22 17:10

Dieter Menne