format the x-axis at plotting (have x10^5) at the end

조회 수: 5 (최근 30일)
Sam Alex
Sam Alex 2012년 12월 25일
Hello,
I have a quick question: how do I have matlab print the x-axis in the form of say: 1, 2, 3, 4, 5 and then at the end it prints x10^5 (the five appears as a superscript)
Thanks

채택된 답변

Wayne King
Wayne King 2012년 12월 25일
Can you get it to work by using a combination of the way you define the x-axis and the XTick property?
x = 1e5:1e5:5e5;
y = randn(5,1);
plot(x,y,'b-o')
set(gca,'xtick',1e5:1e5:5e5);
  댓글 수: 2
Sam Alex
Sam Alex 2012년 12월 25일
Thank you :)
Sam Alex
Sam Alex 2012년 12월 25일
편집: Sam Alex 2012년 12월 25일
But why when I do the same for 0-10,000 using: set(gca,'xtick',0:1e3:1e4) it give me the same original scale using 1000, 2000, and so on?

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by