Add grid lines onto the 3D mesh plot
35 次查看(过去 30 天)
显示 更早的评论
Hi,
I have two different mesh plots for comparison below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/927234/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/927239/image.jpeg)
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 个评论
KSSV
2022-3-15
When you plot using Surf, default edgecolors will be on. How did you plot this, show us your code.
回答(2 个)
KSSV
2022-3-16
[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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!