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

50 ビュー (過去 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 Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by