Dear all I want to display 4 dimensional space by some suitable way. I searched CRAN and found miscellaneous 3 dim graphics packages which I maybe can modify but anyway I am open to any hint how to efficiently display data like: longitude, latitude, height, value Thank you Petr Pikal petr.pikal at precheza.cz
On Jan 10, 2008 8:36 AM, Petr PIKAL <petr.pikal at precheza.cz> wrote:> Dear all > > I want to display 4 dimensional space by some suitable way. I searched > CRAN and found miscellaneous 3 dim graphics packages which I maybe can > modify but anyway I am open to any hint how to efficiently display data > like: > > longitude, latitude, height, valueWhat exactly are you interested in? I'd start with plots of: * long, lat, height * long, lat, value * height, value to give you a feel for what is going on. Hadley -- http://had.co.nz/
Petr PIKAL wrote:> > I want to display 4 dimensional space by some suitable way. >You probably need an LSD monitor :-)> I searched CRAN and found miscellaneous 3 dim graphics > packages which I maybe can modify but anyway I am open > to any hint how to > efficiently display data like: > > longitude, latitude, height, value >I imagine you want to plot a function with domain R^2 and contradomain R^2? Check this: http://en.wikipedia.org/wiki/Image:WeierstrassP.png It's the graphic of a function that takes complex numbers and returns complex numbers (and it was done in R); the way to plot this was: f: (x + y i) -> (x' + y' i) x, y : normal (x,y) coordinates in the plot x', y': converted to a color code, where the radius sqrt(x'^2 + y'^2) became the intensity ('value', in the hsv function) and the direction atan2(y',x') became the hue Probably you could do the same here, converting height and value to colors? OTOH, if it's a function from R^3 to R: f: (lat, lon, h) -> (value) then I guess the best way is to replace one dimension to time, and create animations. Alberto Monteiro
Thanks to all who replied. I will check all suggestions to see what is the best one in respect of readability. Suggestion of using LSD monitor from Alberto is quite attracting however I am not sure if legal :-) Thank you again and best regards. Petr petr.pikal at precheza.cz jiho <jo.irisson at gmail.com> napsal dne 10.01.2008 18:46:12:> > On 2008-January-10 , at 17:41 , Petr PIKAL wrote: > > Thank you > > > > Basically I have a rectangular space (like an aquarium) in which I > > made > > some analysis. > > I can make > > > > image(lat, long, value) for each height but what I dream about is to > > make > > something like scatterplot3d(lat, long, height) with points set > > according > > to a value. > > > > Up to now i can do > > > > scatterplot3d(sloupecn, radan, vrstvan, color=as.numeric(cut(value, > > c(0, > > 100, 400, 1000)))) > > > > which will give you green and red points in upper right corner. I > > started > > to try to make cex.symbols scaled according to value too but up to > > now I > > did not manage to work correctly. > > > > in > > > > scatterplot3d(sloupecn, radan, vrstvan, cex.symbols = value/ > > max(value)+2, > > color=as.numeric(cut(value, c(0, 100, 400, 1000)))) > > > > the biggest points are at other places then I expected. > > so you have measures at x,y,z points basically. and your measures > appear to be on z layers so you can probably make several x,y plots > with point size according to value, stacked on top of each other or > side by side. one liner ggplots: > > A=read.table("petr.txt",header=T) > library("ggplot2") > # stacked > ggplot(A,aes(x=x,y=y)) + geom_point(aes(size=value, colour=factor(z))) > + scale_size(to=c(0,10)) + scale_colour_hue(alpha=0.3) > # side by side > ggplot(A,aes(x=x,y=y)) + geom_point(aes(size=value)) + > scale_size(to=c(0,10)) +facet_grid(z~.) > > if you want 3d to explore your data, rgl (in which you can rotate > plots etc) is probably the best choice > > # 3D with rgl > library("rgl") > open3d() > spheres3d(A$x,A$y,A$z,A$value/1000) > # NB. scaling your value is necessary since the values are so big > compared to the coordinates > axes3d() > > hope that helps. > > petr.txt: > > x y z value > 1 4 1 73.8 > 1 4 9 54.9 > 1 4 17 72 > 1 1 1 96 > 1 1 9 52.1 > 1 1 17 53.3 > 4 4 1 58.4 > 4 4 9 93.5 > 4 4 17 140.2 > 4 1 1 90.3 > 4 1 9 36.5 > 4 1 17 55.1 > 7 4 1 169.1 > 7 4 9 718 > 7 4 17 813 > 7 1 1 73.4 > 7 1 9 46.5 > 7 1 17 205 > > > JiHO > --- > http://jo.irisson.free.fr/ > >
Hi Petr, Mike Prager has implemented a 4D contour plot in R. You might find this useful. Find an example and the code at: http://addictedtor.free.fr/graphiques/graphcode.php?graph=90 HTH, Mark. Petr Pikal wrote:> > Dear all > > I want to display 4 dimensional space by some suitable way. I searched > CRAN and found miscellaneous 3 dim graphics packages which I maybe can > modify but anyway I am open to any hint how to efficiently display data > like: > > longitude, latitude, height, value > > Thank you > > Petr Pikal > petr.pikal at precheza.cz > > ______________________________________________ > R-help at 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. > >-- View this message in context: http://www.nabble.com/4-dimensional-graphics-tp14735631p14800537.html Sent from the R help mailing list archive at Nabble.com.
Thank you but this is not exactly what I wanted. I have seen this graph and checked that it is a plot of 2 response variables plotted according to 2 control variables. e.g. it shall be lat, log, value1, value2 data However I have fixed lat, long, height as a control variables and value as dependent variable so I either end with slices of contours in fixed height or I try to accomadate other suggestions. Thank you again. Best regards Petr petr.pikal at precheza.cz r-help-bounces at r-project.org napsal dne 14.01.2008 13:12:21:> > Hi Petr, > > Mike Prager has implemented a 4D contour plot in R. You might find this > useful. Find an example and the code at: > > http://addictedtor.free.fr/graphiques/graphcode.php?graph=90 > > HTH, > Mark. > > > Petr Pikal wrote: > > > > Dear all > > > > I want to display 4 dimensional space by some suitable way. I searched> > CRAN and found miscellaneous 3 dim graphics packages which I maybe can> > modify but anyway I am open to any hint how to efficiently displaydata> > like: > > > > longitude, latitude, height, value > > > > Thank you > > > > Petr Pikal > > petr.pikal at precheza.cz > > > > ______________________________________________ > > R-help at 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. > > > > > > -- > View this message in context:http://www.nabble.com/4-dimensional-graphics-> tp14735631p14800537.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
You could try GGobi (www.ggobi.org) to explore the dataset, nevertheless it is not useful for charts that are to be printed . There is an R-Plugin (rggobi) as well.> Thank you but this is not exactly what I wanted. I have seen thisgraph> and checked that it is a plot of 2 response variables plottedaccording to> 2 control variables. e.g. it shall be > lat, log, value1, value2 data > However I have fixed > lat, long, height as a control variables and value as dependentvariable> so I either end with slices of contours in fixed height or I try to > accomadate other suggestions. > > Thank you again. > Best regards > > Petr > petr.pikal at precheza.cz > > r-help-bounces at r-project.org napsal dne 14.01.2008 13:12:21: > > > > > Hi Petr, > > > > Mike Prager has implemented a 4D contour plot in R. You might findthis> > useful. Find an example and the code at: > > > > http://addictedtor.free.fr/graphiques/graphcode.php?graph=90 > > > > HTH, > > Mark. > > > > > > Petr Pikal wrote: > > > > > > Dear all > > > > > > I want to display 4 dimensional space by some suitable way. Isearched> > > > CRAN and found miscellaneous 3 dim graphics packages which I maybecan> > > > modify but anyway I am open to any hint how to efficiently display> data > > > like: > > > > > > longitude, latitude, height, value > > > > > > Thank you > > > > > > Petr Pikal > > > petr.pikal at precheza.cz > > > > > > ______________________________________________ > > > R-help at 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. > > > > > > > > > > -- > > View this message in context: > http://www.nabble.com/4-dimensional-graphics- > > tp14735631p14800537.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help at 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-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.