How to scale an axis on a plot in powers of 10?

조회 수: 16 (최근 30일)
Fanatic
Fanatic 2020년 9월 20일
댓글: Star Strider 2020년 9월 20일
I have a plot of experimental data and the x-axis is scaled from to , but I want it to be scaled in powers of 10 from to . What could I do to fix this axis scaling issue?
Any help would be greatly appreciated!

채택된 답변

Star Strider
Star Strider 2020년 9월 20일
Set xlim to the limits you want.
Example —
x = logspace(5, 6, 25); % Create Data
y = rand(size(x)); % Create Data
figure
semilogx(x, y)
grid
xlim([1E2 1E6])
.
  댓글 수: 2
Fanatic
Fanatic 2020년 9월 20일
Thank you, it worked!
Star Strider
Star Strider 2020년 9월 20일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by