Why does "pcolor" not display grid lines or ticks?
78 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 16 Sep 2014
Réponse apportée : MathWorks Support Team
le 16 Sep 2014
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
Réponse acceptée
MathWorks Support Team
le 16 Sep 2014
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Geographic Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!