Plotting with plot3 and patch
3 views (last 30 days)
Show older comments
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 Comments
Nico Dieckmann
on 27 Jan 2023
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
Answers (0)
See Also
Categories
Find more on Polygons 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!