Changing a graph axis numbers

2 ビュー (過去 30 日間)
Burak Dermenci
Burak Dermenci 2016 年 12 月 18 日
回答済み: Mischa Kim 2016 年 12 月 18 日
Hello all,
I tried to plot 4 graph. Three of them has x-axis with a scale between 0 and 2.5 x 10^-4. The last one, however, between 0 and 20000. I want fix its scale 0 and 2.5 x 10^-4 just like the others. How should I do that?
Thank you for your help.
  2 件のコメント
Mischa Kim
Mischa Kim 2016 年 12 月 18 日
Burak, not quite sure what you mean. Can you attach a screen shot with all 4 plots?
Burak Dermenci
Burak Dermenci 2016 年 12 月 18 日
Dear Mischa,
Thank you for your interest. Please find attached the screenshot (sorry for the resolution). As you can see some of y axis are in a format of 18000 etc. Some of them are 1.8 x 10^-4. I want to plot them with the axis of same format.

サインインしてコメントする。

回答 (2 件)

Star Strider
Star Strider 2016 年 12 月 18 日
Use the axis or set functions to set the limits.
For example:
set(gca, 'XLim',[0 2.5E-4])
or:
set(subplot(2,2,4), 'XLim', [0 2.5E-4])

Mischa Kim
Mischa Kim 2016 年 12 月 18 日
Burak, use the axis command. E.g.
t = 0:0.01:2;
y = exp(-t).*(sin(20*t).^3);
subplot(2,2,1)
plot(t,y)
axis([0.5 1.5 -0.6 1])
subplot(2,2,2)
plot(t,y)
In your case you need to adjust the axis in subplot(2,2,4)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by