surf plot grid line density

43 views (last 30 days)
buscuit
buscuit on 28 Sep 2012
Commented: kevin cheng on 7 Apr 2021
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

Accepted Answer

Doug Hull
Doug Hull on 28 Sep 2012
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.

More Answers (1)

Sigfrid-Laurin Sindinger
Sigfrid-Laurin Sindinger on 1 Oct 2019
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 Comment
kevin cheng
kevin cheng on 7 Apr 2021
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.

Sign in to comment.

Categories

Find more on Graphics Performance 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!