Force 0 tick to appear in a scatter plot
Afficher commentaires plus anciens
I cannot make the 0 tick appear nomatter what I tried. Here is my code.
clc, clear, clf
n = 0:10; f = n.^2;
scatter(n,f, 'k', 'filled')
xlim([-1,11]), ylim([-10,120])
ax = gca;
ax.XAxisLocation = 'origin'; ax.YAxisLocation = 'origin';
ax.XTick = -2:2:10; ax.YTick = -20:20:120;
xlabel('n'), ylabel('f(n)=n^2')
title('Sequence f(n)=n^2')
grid on; grid minor
For the sake of clarity, I wanted the ticks in the origin to appear explicitly as in the following figure (the rest of the plot is irrelevant).

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Axes Appearance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

