Effacer les filtres
Effacer les filtres

Limit plot's x-axis to number of rows in a specified vector

2 vues (au cours des 30 derniers jours)
balsip
balsip le 21 Déc 2016
Commenté : Star Strider le 21 Déc 2016
Hello All,
I've got an easy one for you:
I want to limit the x-axis on a plot from 0 to the total number of rows in the "A" vector. Code so far is:
xlim(0, ______ );
I'm going to file this one in the too-fried-at-the-moment category.

Réponse acceptée

Star Strider
Star Strider le 21 Déc 2016
Modifié(e) : Star Strider le 21 Déc 2016
Assuming you’re plotting by indices:
axis([0 length(A) ylim])
or:
set(gca, 'XLim',[0 length(A)])
If you want to use the last value in ‘A’, replace ‘length(A)’ with ‘A(end)’ in those function calls.
  2 commentaires
balsip
balsip le 21 Déc 2016
Word. As always, a better way than what I was envisioning. Thanks, Strider!
Star Strider
Star Strider le 21 Déc 2016
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 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!

Translated by