On 25/02/2011 8:21 AM, Lorenzo Isella wrote:
Dear All,
I need to plot some points on the surface of a sphere, but I am not sure
about how to proceed to achieve this in R (or if it is suitable for this
at all).
In any case, I am not looking for really fancy visualizations; for
instance you can consider the images between formulae 5 and 6 at
http://bit.ly/hOgK9h
Any suggestion is appreciated.
Those plots show simple linear projections of the points, after culling
those that are on the far side of the sphere. That's very easy for the
points, slightly more work for the grid. I'm not aware of any package
that implements all of it, but you could do it yourself fairly easily.
If you want something more fancy you could use the rgl package for 3d
plots that you can rotate. You'll still have to draw the grid, and
you'll probably find it a little painful to implement the hidden surface
removal: rgl uses depth checking to remove things, and because of
rounding error it's not very good at drawing points and lines on
surfaces. (There are new options to control depth checking; see
"depth_mask" and "depth_test" in ?material3d. You can probably improve
the default behaviour using those).
Duncan Murdoch
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.