Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

3D Scatter plot with error bars

74 views
Skip to first unread message

Mark Robinson

unread,
Nov 29, 2007, 8:56:50 AM11/29/07
to
Hi,

I have data that contains average x,y,z co-ordinates. To
plot their position and their variance I would like to draw
a 3D scatter plot with x,y,z error bars (indicating
veriance in each direction).

Firstly can this be done? I have only seen x error bars on
line graphs discussed in the help files.

Secondly it it possible to plot this data in a scatter plot.

Thanks
Mark

checker

unread,
Nov 30, 2007, 1:18:55 PM11/30/07
to

All I could come up with quickly was the brute force method, and
perhaps this isn't really what a 3d scatter w/errors is all about.
But it was kind of fun. I'd like to hear from someone wise in the
ways of graphic handles wrt the point areas of a 3d scatter plot.
Maybe there's a smarter way to do this. Here's some rough code:

%poorman's 3dscatter w/errors
%create some data
x=20*rand(10,1); xl = x-.2*rand(10,1); xu= x+.3*rand(10,1);
y=20*rand(10,1); yl = y-.2*rand(10,1); yu= y+.3*rand(10,1);
z=20*rand(10,1); zl = z-.2*rand(10,1); zu= z+.3*rand(10,1);

for jj = 1:10
plot3([xl(jj);x(jj);xu(jj)],[y(jj);y(jj);y(jj)],
[z(jj);z(jj);z(jj)]);
hold on
plot3([x(jj);x(jj);x(jj)],[yl(jj);y(jj);yu(jj)],
[z(jj);z(jj);z(jj)])
plot3([x(jj);x(jj);x(jj)],[y(jj);y(jj);y(jj)],
[zl(jj);z(jj);zu(jj)])
end

-Chris

0 new messages