Why does "pcolor" not display grid lines or ticks?
78 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2014-9-16
回答: MathWorks Support Team
2014-9-16
I have created the following figure with "pcolor", but grid lines or ticks do not show up. How do I get them to display?
x=-2:0.1:2;
y=-2:0.1:2;
vals=rand(41);
p=pcolor(x,y,vals)
set(p,'EdgeColor','none')
grid on
采纳的回答
MathWorks Support Team
2014-9-16
The grid is being drawn in the background layer of the figure. The colors in this figure are covering up the grid line.
You can bring the grid to the top layer by adding the following command right after the "grid on" command:
set(gca,'layer','top')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!