surf plot grid line density
조회 수: 35 (최근 30일)
이전 댓글 표시
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?
Any help is appreciated, thanks
댓글 수: 0
채택된 답변
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개)
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
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 Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!