0

surf(x,y,z) where z is oscillatory. Therefore x,y are 100x100. I want the gridlines (don't want to use flat or interp options). However, too many gridlines don't look good. Looking for a way to reduce gridlines by 50% or 75% etc. in both x and y coord.

Karl
  • 31

1 Answers1

0

To supplement the comments, here's a quick demonstration of what's going on.

enter image description here

Code:

f = @(x,y) exp(-x.^2 - y.^2);
L = 2;
dx = .01;

dy = dx; x = -L:dx:L; y = x; [X,Y] = meshgrid(x,y); Z = f(X,Y);

tiledlayout(2,2); nexttile surf(X,Y,Z); title('Default')

nexttile surf(X,Y,Z,'EdgeAlpha',0.2) title('EdgeAlpha = 0.2')

nexttile surf(X,Y,Z,'LineStyle',':') title('Line Style = :')

nexttile surf(X,Y,Z,'LineStyle','-.') title('Line Style = -.')

Ben Grossmann
  • 225,327