3D density plot of point set

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

3D density plot of point set

Lutz Gehlen
Hello everybody,
I would like to solve the problem described below in R (if
possible). I am very new to R and have therefore no idea what to
even look for in the docu. Therefore, if someone could tell me if
this is possible in R and where I might find the respective docu
then I would already be very thankful.

I have a large set (a few million) of points in 3D. I would like to
create a contour density plot that would show a surface of constant
density which includes e.g. 50% of the points. Ideally, the surface
would be semitransparent, such that I can show two or three at the
same time.

Alternatively, if I would calculate the contour surfaces myself,
could I use R to semitransparently visualize a triangulated surface?

Thank you very much for your help
Lutz

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: 3D density plot of point set

Duncan Murdoch-2
On 13/07/2011 3:56 AM, Lutz Gehlen wrote:

> Hello everybody,
> I would like to solve the problem described below in R (if
> possible). I am very new to R and have therefore no idea what to
> even look for in the docu. Therefore, if someone could tell me if
> this is possible in R and where I might find the respective docu
> then I would already be very thankful.
>
> I have a large set (a few million) of points in 3D. I would like to
> create a contour density plot that would show a surface of constant
> density which includes e.g. 50% of the points. Ideally, the surface
> would be semitransparent, such that I can show two or three at the
> same time.
>
> Alternatively, if I would calculate the contour surfaces myself,
> could I use R to semitransparently visualize a triangulated surface?

For the latter, see the misc3d package, in particular the contour3d
function. Use the rgl engine with alpha=0.5 (or some other value) for
semi-transparency.

For computing the density estimates there are lots of choices, including
the kde3d function that's also in the misc3d package.

To find the contour holding 50% of the points, compute the density at
all of them, and find the median density.

Duncan Murdoch

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: 3D density plot of point set

Lutz Gehlen
Hello Duncan,
thank you for your reply. I will have a look at the misc3d package
and at contour3d and kde3d in particular.

Cheers,
Lutz

______________________________________________
[hidden email] 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.