Sparse mesh on a surface plot with dense sampling
Show older comments
Hi everyone!
At the surface plot example of Matlab, we have the following commands:
[X,Y,Z] = peaks(25);
CO(:,:,1) = zeros(25); % red
CO(:,:,2) = ones(25).*linspace(0.5,0.6,25); % green
CO(:,:,3) = ones(25).*linspace(0,1,25); % blue
surf(X,Y,Z,CO)
which produce the following figure:

If we increase the number of samples from 25 to 100, the mesh grid of the surface becomes denser:

Is there an easy way to have the smoothness of the secone one, with the grid of the first one? For example to show every N-th line (here, for example, 100/25 = 4, so every 4th line)?
Plotting the sparse mesh grid over a mesh-free surface won't help me, I want to be able to do this through the properties of the generated figure, as I want to be able to do this for figures produced by apps like the Curve Fitting app etc.
Thank you for your time!
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots 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!