MATLAB Answers

How to get rid of this line that connects the last and first point, I have made it white so its barely visible, but is there a way to not plot it?

2 views (last 30 days)
Soban Soban
Soban Soban on 24 Oct 2021
Commented: Image Analyst on 24 Oct 2021
WayPTS = [5,4,1;
plot3 (WayPTS(:,1), WayPTS(:,2), WayPTS(:,3),'black',...
[WayPTS(end,1) WayPTS(1,1)],[WayPTS(end,2) WayPTS(1,2)],[WayPTS(end,3) WayPTS(1,3)],'white')

Answers (1)

Matt J
Matt J on 24 Oct 2021
plot3 (WayPTS(:,1), WayPTS(:,2), WayPTS(:,3),'black');
  1 Comment
Image Analyst
Image Analyst on 24 Oct 2021
You could also try increasing the 'LineWidth' to 2 or more to make it appear even smoother and more solid :
plot3 (WayPTS(:,1), WayPTS(:,2), WayPTS(:,3),'black', 'LineWidth', 2);
grid on;
xlabel('x', 'FontSize', 18);
ylabel('y', 'FontSize', 18);
zlabel('z', 'FontSize', 18);

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!