[R] limit ranges in hexbin

2011-12-11 Thread Lutz Gehlen
Hello everybody,
I hope you can give me some help with limiting the ranges in x, y, and z for a 
hexbin plot. All I have found on the net is an unanswered message to this list 
from last year, so I hope my problem is not too stupid.

I would like to plot some data using hexagonal binning. Currently, I am doing 
the following:

library(hexbin)
data-scan(input.dat, what = list('numeric', 'numeric'))
x-unlist(data[1])
y-unlist(data[2])
hbin-hexbin(x, y)
plot(hbin)

That does get me a hexgonal bin plot, so far, so good. My problem now is 
twofold:
1) Some of my data points have really high values in x and y, and I would like 
to exclude them. First idea was to set xbnds and ybnds parameters for hexbin 
like this.

hbin-hexbin(x, y, xbins = 50, xbnds = c(0, 5000))

However, hexbin does not like it: Error in hexbin(x, y, xbins = 50, xbnds = 
c(0, 5000)) : 'xbnds' must encompass range(x). Is there some other way to 
enforce limits in x and y? Otherwise, I could, of course, prefilter my data.

2) The second problem is limiting the count values. My counts are strongly 
dominated by one bin. So I end up with that bin being black and some others 
very light gray. I would like to set the black value to some lower number. Of 
course, some bins will be saturated then, but for that I will get better 
contrast in the range I am interested in.

Thanks a lot for your help,
Lutz

__
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.


[R] 3D density plot of point set

2011-07-13 Thread 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

__
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.


Re: [R] 3D density plot of point set

2011-07-13 Thread 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

__
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.