Plotting 2D objects on 3D plots
6 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Walter Roberson
on 26 Jan 2011
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?
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!