Sparse mesh on a surface plot with dense sampling
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nick Kyparissas
el 3 de Nov. de 2022
Comentada: Nick Kyparissas
el 3 de Nov. de 2022
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!
0 comentarios
Respuesta aceptada
Matt J
el 3 de Nov. de 2022
Editada: Matt J
el 3 de Nov. de 2022
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.
That doesn't rule out overlaying 2 surface plots. All apps that I an think of allow you to export the results in code form, which you can then modify. You are never stuck with just a plot.
Otherwise, no, it's not possible. If you find the dense grid lines obtrusive, you could get rid of them, or make them more transparent:
[X,Y,Z] = peaks(100);
CO(:,:,1) = zeros(100); % red
CO(:,:,2) = ones(100).*linspace(0.5,0.6,100); % green
CO(:,:,3) = ones(100).*linspace(0,1,100); % blue
surf(X,Y,Z,CO,'EdgeAlpha',0.3)
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
