Effacer les filtres
Effacer les filtres

x and y ticks in pcolor plots

44 vues (au cours des 30 derniers jours)
Cesium Modern
Cesium Modern le 16 Fév 2023
Commenté : Les Beckham le 16 Fév 2023
I have a p-color plot with the 'EdgeColor' property set to none.
This not only eliminates the grid (which I do not want) but removes the x and y-axes ticks.
How can I enable these ticks and show them outside the plot, with the following
set(gca,'TickDir','out')
Below is what I am trying to achieve with the ticks

Réponse acceptée

Voss
Voss le 16 Fév 2023
Set the axes property 'Layer' to 'top' in order to get the grid to show up on top of the pcolor surface.
% a pcolor with EdgeColor 'none':
set(pcolor(zeros(100)),'EdgeColor','none')
% set axes properties:
set(gca(), ...
'XGrid','on', ...
'YGrid','on', ...
'Layer','top', ...
'TickDir','out', ...
'TickLength',[0.05 0.05])
  4 commentaires
Cesium Modern
Cesium Modern le 16 Fév 2023
Thanks, Les Beckham and Voss. Appreciate the help!
Les Beckham
Les Beckham le 16 Fév 2023
You are quite welcome.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by