How to change ONLY Xtick direction (or Ytick direction)

83 vues (au cours des 30 derniers jours)
Erez
Erez le 11 Nov 2019
Commenté : Erez le 11 Nov 2019
I know I can set the tick direction to be pointing in our outside the plot box with
set(gca, 'TickDir', 'out')
I am trying to ONLY change the Xticks to point out but 'XTickDir' is not a property and I can't find anything in the docs about changing only 1 direction. Is it possible?

Réponse acceptée

Daniel M
Daniel M le 11 Nov 2019
You have to set the properties of the specific axis.
figure
plot(1:10)
ax = gca;
xax = ax.XAxis; % xax = get(ax,'XAxis');
set(xax,'TickDirection','out')
  1 commentaire
Erez
Erez le 11 Nov 2019
Exactly what I was looking for. Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by