필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
balsip
balsip 2016년 12월 21일
댓글: Star Strider 2016년 12월 21일
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.

채택된 답변

Star Strider
Star Strider 2016년 12월 21일
편집: Star Strider 2016년 12월 21일
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
balsip
balsip 2016년 12월 21일
Word. As always, a better way than what I was envisioning. Thanks, Strider!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by