Plotting 2D objects on 3D plots
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2011년 1월 26일
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?
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!