필터 지우기
필터 지우기

change scaling of x-axis

조회 수: 33 (최근 30일)
Don
Don 2017년 9월 15일
댓글: Star Strider 2017년 9월 15일
I have data in IDCount(1,:) that goes from 0 to, say, 260. I want to rescale so the x-axis will appear in seconds -- IDCount(1,:)/140. Cannot see how to do this

채택된 답변

Star Strider
Star Strider 2017년 9월 15일
Try this:
x = 0:260; % Create Data
y = rand(size(x)); % Create Data
figure(1)
plot(x, y)
xt = get(gca, 'XTick'); % 'XTick' Values
set(gca, 'XTick', xt, 'XTickLabel', xt/140) % Relabel 'XTick' With 'XTickLabel' Values
The set call relabels the 'XTick' values with the same values divided by 140.
  댓글 수: 2
Don
Don 2017년 9월 15일
Thank you! That fixed it
Star Strider
Star Strider 2017년 9월 15일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by