surf plot grid line density

조회 수: 35 (최근 30일)
buscuit
buscuit 2012년 9월 28일
댓글: kevin cheng 2021년 4월 7일
Hi everybody,
I am trying to resolve this the last couple of days but no lack. I have a surf plot and I need to have a certain amount of points on it for detail. I need the surf plot to be red. No colormap. The grid because of resolution is making my plot totally black at points. And I can't see the details. Is there a way to make the grid less dense without decreasing the resolution of my data? Alternatively is there a way to use shading on the red surface plot to show the details of it?
here is a link of one plot using a grid and one without. None of them is good enough: Image
Any help is appreciated, thanks

채택된 답변

Doug Hull
Doug Hull 2012년 9월 28일
You seem to have learned how to turn off the gridlines. The best thing I can think to do is:
hold on
Then take a subset of your data (like every third column and third row or whatever. Then surf that, with color none for the facecolor. That should overlay a grid with less resolution.
  댓글 수: 1
buscuit
buscuit 2012년 9월 28일
clever! thanks!

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

추가 답변 (1개)

Sigfrid-Laurin Sindinger
Sigfrid-Laurin Sindinger 2019년 10월 1일
Hi,
the suggestion by Doug could look as follows (worked for me):
figure
S = surf(XX,YY,ZZ);
s.EdgeColor = 'none';
hold on
spacing = 40; % play around so it fits the size of your data set
for i = 1 : spacing : length(XX(:,1))
plot3(XX(:,i), YY(:,i), ZZ(:,i),'-k');
plot3(XX(:,i), YY(:,i), ZZ(:,i),'-k');
end
Best regards,
Sig
  댓글 수: 1
kevin cheng
kevin cheng 2021년 4월 7일
The second line in the for loop should read:
plot3(XX(i,:), YY(i,:), ZZ(i,:),'-k');
The grid pattern in this solution more closely follows the surface. The solution given by Doug may provide some clipping artifacts if the grid pattern spacing is too large.

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by