Francesco Stablum
2009-May-21 09:40 UTC
[R] [newbie] how to do a 3d plot of bivariate density?
Hello everybody. I am new to R. Yesterday I passed the afternoon reading the introduction and language reference, but I could'nt find a way to do a 3d plot of the density of a data table of size 2. I am trying with: plot(density(t(t2))) but it mixes the two columns and calculate the density like it is a 1-dimensional casual variable. I have looked at the documentation of density, but I was not able to do it. I have also spent quite a lot time looking in the internet for similar issues, but found nothing helpful. any suggestions? thanks -Francesco Stablum P.S. sorry for my poor english -- The generation of random numbers is too important to be left to chance - Robert R. Coveyou
Richard.Cotton at hsl.gov.uk
2009-May-21 10:44 UTC
[R] [newbie] how to do a 3d plot of bivariate density?
> I am new to R. Yesterday I passed the afternoon reading the > introduction and language reference, but I could'nt find a way to do a > 3d plot of the density of a data table of size 2. > I am trying with: > > plot(density(t(t2))) > > but it mixes the two columns and calculate the density like it is a > 1-dimensional casual variable.I presume what you mean by a data table of size 2 is something like this: data <- matrix(c(3,53,36,17), nrow=2) 3D plots are almost never the best solution. (You get all sorts of issues with perspective problems and some bits of the plot being obscured by other bits.) Would something like this to the trick? image(data) If you want something different, then please provide an example of your data (nothing too big, so we can reproduce it), and a description of what you would like to show. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
Maybe Matching Threads
- How is the relation between Frequency and Counts in hist/density defined?
- Plot bivariate density with densities margins
- How to calculate density function of Bivariate binomial distribution
- bandwidths for bivariate density estimation
- bivariate weighted kernel density estimator