MATLAB Answers

How can I make points show through a surface plot?

조회 수: 2(최근 30일)
Samuel Harvey
Samuel Harvey 2021년 7월 28일
댓글: Samuel Harvey 2021년 7월 28일
I have code that makes a centerline (left) then creates a surface around that centerline (right). I'd like the centerline points to show through the surface so I can still see them while I rotate it around. How can I do this?
Edit: To be more clear, I am specifically not looking for the entire surface to be transparent. I don't want to see the back side of the surface showing through, just the centerline.

채택된 답변

Chunru 2021년 7월 28일
% Plot a sphere and a line
[x, y, z] = sphere;
h = surf(x, y, z);
hold on
plot3(-1:1, zeros(3,1), zeros(3,1), 'r', 'LineWidth', 3);
h.FaceAlpha = 0.5; % make it transparent to see inside
  댓글 수: 3
Samuel Harvey
Samuel Harvey 2021년 7월 28일
Perfect, that's what I'm looking for. Thank you!

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

추가 답변(0개)




Community Treasure Hunt

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

Start Hunting!

Translated by