Plotting 2D objects on 3D plots

Hi,
I have 371 points plotted on a 3D graph using either scatter3 or plot3. I would like to represent error in the x and y directions with 2D ellipses (I have been using the rectangle function, using a Curvature of [1,1]) so these would have to be plotted at the z level to be placed around the point.
For example: 1) Point: x=-103.618, y=19.502, z=49; Error: x-radius=0.02731, y-radius=0.0127 plotted around the point at z=49 2) Point: x=-103.619, y=19.537, z=8; Error: x-radius=0.00885, y-radius=0.00832 plotted around the point at z=8
I have plotted the points and 'rectangles' in a 2D plot using the same x and y's as above but can't seem to get them to plot when I add the 3rd dimension.
Currently I'm using very simple code:
rows=length(w);
for i=1:rows;
plot3(goessum30(w(i),1),goessum30(w(i),3),goessum30(w(i),5),'.b')
rectangle('Position',[(goessum30(w(i),1)-goessum30(w(i),2)),(goessum30(w(i),3)- goessum30(w(i),4)),(goessum30(w(i),2)*2),(goessum30(w(i),4)*2)],'Curvature',[1,1],'LineWidth',1,'LineStyle','-','EdgeColor','b')
hold on;
end
Thanks for your help, Jo

Réponses (1)

Walter Roberson
Walter Roberson le 26 Jan 2011

0 votes

It is not possible to set properties of rectangle objects to move them in the Z plane.
Are you sure using a 2D object is what you want? What if the user rotates the plot?

1 commentaire

Jo
Jo le 26 Jan 2011
Hi Walter,
I'm not sure what would be best here. I don't have an error in the z direction.
I want to be able to illustrate the error in the x & y direction in the 3D space (so plotted around the point at the corresponding z value) because when the 'rectangles' and points are plotted in 2D space they overlap so much that the plot no longer has meaning.
Thanks again

Connectez-vous pour commenter.

Question posée :

Jo
le 26 Jan 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by