Why does "pcolor" not display grid lines or ticks?

78 ビュー (過去 30 日間)
MathWorks Support Team
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
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 件)

カテゴリ

Help Center および File ExchangeGeographic Plots についてさらに検索

タグ

製品


リリース

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by