Plotting with plot3 and patch

조회 수: 4 (최근 30일)
Cameron Crook
Cameron Crook 2016년 12월 8일
댓글: Nico Dieckmann 2023년 1월 27일
I have a script which is plotting some 3d objects made with patch. I would also like to plot the trajectory of one of the objects. I am using plot3 to do this. However, I cannot find a way to plot both on the same figure despite hold on already being used. Any thoughts?
  댓글 수: 2
KSSV
KSSV 2016년 12월 8일
It has to work...why don't you post you code here?
Nico Dieckmann
Nico Dieckmann 2023년 1월 27일
Hello,
i have the same problem. The Code i use is from you KSSV. It works very well. But i want to plot some additional points in the same figure using the plot3 function. Unfortunately this does not work. What am i doing wrong?
Code:
figure
cellfun(@patch,repmat({'Vertices'},1,nel),XYZ,.......
repmat({'Faces'},1,nel),repmat({fm},1,nel),......
repmat({'FaceVertexCdata'},1,nel),profile,......
repmat({'FaceColor'},1,nel),repmat({'interp'},1,nel));
view(3)
set(gca,'XTick',[]) ; set(gca,'YTick',[]); set(gca,'ZTick',[]) ;
axis on;
SetColorbar
hold on
plot3(PointCoordinate(:,1),PointCoordinate(:,2),PointCoordinate(:,3),'.','Color','red','MarkerSize',10);
Hopefully, you can help me.
Best Regards

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by