フィルターのクリア

Why is y-axis in loglog not 0?

2 ビュー (過去 30 日間)
Daniel
Daniel 2014 年 11 月 20 日
コメント済み: Thorsten 2014 年 11 月 24 日
Hello,
I am plotting with "loglog". See code.
Why does the y-axis start at 100 and not 0 as I say it should be with y-lim?
MockF1=[120 100 100 140 140 180 180 100 100 100 100];
MockN1=[38500 20000 23720 4096 4532 2754 1820 16921 8241 40622 19040]; figure
loglog(MockN1,MockF1,'o')
xlabel('N');
ylabel('F');
grid on
xlim([0 500000])
ylim([0 250])

採用された回答

Thorsten
Thorsten 2014 年 11 月 21 日
編集済み: Thorsten 2014 年 11 月 21 日
If you do not have to use a loglog plot, semilogx may be useful
semilogx(MockN1,MockF1,'o')
ylim([0 250])
  2 件のコメント
Daniel
Daniel 2014 年 11 月 21 日
Thank you. I guess I can work with a semilogx but I would prefer loglog.
A follow up question: My y-axis is now in steps of 50. 0 50 100...etc. How can I get it in to steps of 10 or whatever I choose?
Thorsten
Thorsten 2014 年 11 月 24 日
set(gca, 'YTick', 100:10:180)

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

その他の回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 11 月 20 日
編集済み: Azzi Abdelmalek 2014 年 11 月 20 日
I think when you set ylim([0 200]) this will be interpreted as [log(0) log(200)]. That means [-Inf log(200)]

Daniel
Daniel 2014 年 11 月 21 日
Thank you Azzi,
When I use: ylim([-inf 200]), I get as seen in the first picture
when I use ylim([-inf log(200)]), I get this
How do I get the values on the y-axis to say 100 etc and not 10^2 and so on?

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by