[R] 3d scatter plot
Eric Hu
eric.y.hu at gmail.com
Fri Jul 15 23:51:16 CEST 2005
Hey Sundar
I guess it works indeed. I had made a stupid mistake. Thanks.
Eric
On Jul 15, 2005, at 11:24 AM, Sundar Dorai-Raj wrote:
> Hi, Eric,
>
> I plotted a surface using the first two columns as x and y and the
> third column for z:
>
> library(lattice)
> v <- read.table("clipboard")
> names(v) <- c("x", "y", "z")
> wireframe(z ~ x * y, data = v)
>
> The result is attached. Am I missing something?
>
> Thanks,
>
> --sundar
>
> Eric Hu wrote:
>> Ok, I don't think x and y lay on a rectangle which explains why
>> wireframe does not work. BTW, I am really new to R and maybe you can
>> plot those data to prove that I am wrong. Thanks.
>> Eric
>> On Jul 15, 2005, at 10:56 AM, Sundar Dorai-Raj wrote:
>>>
>>>
>>> Eric Hu wrote:
>>>
>>>> Hi, I ran into a dilemma trying to plot the following data in a 3d
>>>> scatter fashion. My data are not always increasing as persp()
>>>> expects. For now I use scatterplot3d to get points in a 3d scatter
>>>> plot. I wonder if I have any way to plot the surfaces. Thanks!
>>>> Eric
>>>> ####sample data
>>>> -0.50 0.40 1.281
>>>> -0.50 0.45 1.795
>>>> -0.50 0.50 1.766
>>>> -0.40 0.35 1.595
>>>> -0.40 0.40 1.388
>>>> -0.40 0.45 2.344
>>>> -0.40 0.50 2.179
>>>> -0.30 0.35 1.792
>>>> -0.30 0.40 2.349
>>>> -0.30 0.45 1.682
>>>> -0.30 0.50 1.493
>>>> -0.20 0.35 1.836
>>>> -0.20 0.40 2.186
>>>> -0.20 0.45 1.863
>>>> -0.20 0.50 1.775
>>>> -0.10 0.25 2.991
>>>> -0.10 0.30 2.426
>>>> -0.10 0.35 1.954
>>>> -0.10 0.40 1.136
>>>> -0.10 0.45 1.438
>>>> -0.10 0.50 1.429
>>>> -0.05 0.30 2.163
>>>> -0.05 0.35 1.953
>>>> -0.05 0.40 1.672
>>>> -0.05 0.45 1.688
>>>> -0.05 0.50 1.963
>>>
>>>
>>>
>>> ?wireframe in the lattice package may help.
>>>
>>> --sundar
>>>
>>>
>>>
> <wf.png>
More information about the R-help
mailing list