How to set plot axes?

figure (1)
plot(A(512,:))
hold on
plot(B(512,:),'r')
How do I specify the axes scale for plots? E.g. Y axes from 0 to 80000; and X axes from 0 to 1100

 채택된 답변

Elizabeth
Elizabeth 2012년 7월 25일
편집: Elizabeth 2012년 7월 25일

0 개 추천

axis([0 1100 0 80000])

추가 답변 (3개)

Walter Roberson
Walter Roberson 2012년 7월 25일

0 개 추천

Normally it is chosen automatically, but you can set the axis XLim and YLim properties.
Note: you ask for x to be 0 to 1100, but you are using the single-input version of plot(), which will default x to be 1:length(Y) and thus will start from 1. If your x should start from 0, then you should be using the two-input version of plot,
plot(x, A(512,:))
S N RAY
S N RAY 2012년 7월 25일

0 개 추천

A related question is setting the exact time to x-axis. For example, how to set the time as say, 04:30:00, 04:35:00 and so on along x axis and frequency as 45 MHz , 50 MHz and so on up to 450 MHz along y-axis.

댓글 수: 1

Walter Roberson
Walter Roberson 2012년 7월 25일
set the xtick and ytick properties, and use datetick() on the x axis with the option to preserve ticks.
You would need to calculate the tick locations, perhaps using add2date()

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

Walter Roberson
Walter Roberson 2012년 7월 29일

0 개 추천

Please review the guide to tags and retag this question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2012년 7월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by