Add grid lines onto the 3D mesh plot
Ältere Kommentare anzeigen
Hi,
I have two different mesh plots for comparison below:


As you may have observed, the plot on top has the concrete black grid lines(forgive me if I used the wrong term), while the bottom plot only has blocks of colors. My goal is to make the plot on the bottom also have the grid lines like the top plot. I've tried to look up the document on mesh plot, but I couldn't find out how to do it. Could someone help me out on this problem, or point me to the right document / tutorial? Thanks so much!
2 Kommentare
KSSV
am 15 Mär. 2022
When you plot using Surf, default edgecolors will be on. How did you plot this, show us your code.
Mingze Yin
am 16 Mär. 2022
Antworten (2)
KSSV
am 16 Mär. 2022
[X,Y,Z] = peaks(1000) ; % data for demo
surf(X,Y,Z) % this will be black
shading interp % this will remove black lines
hold on
idx = 1:20:1000 ; % will draw grid with reduced resolution
plot3(X(idx,idx),Y(idx,idx),Z(idx,idx),'k')
plot3(X(idx,idx)',Y(idx,idx)',Z(idx,idx)','k')
2 Kommentare
Mingze Yin
am 17 Mär. 2022
KSSV
am 17 Mär. 2022
As you said you want to display grid lines, plot3 draws the sparse gridlines.
[X,Y,Z] = peaks(50);
figure
hs = surf(X,Y,Z);
hs.MeshStyle = 'column';
.
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
