Why is the Y axis still in linear scale after setting 'YScale' to 'log'?
21 ビュー (過去 30 日間)
古いコメントを表示
Ni Made Ayu Sinta Dewi
2021 年 7 月 19 日
コメント済み: Ni Made Ayu Sinta Dewi
2021 年 7 月 19 日
Help! I want to show the X and Y in logarithmic scale. The X axis is changing just fine after setting 'XScale' to 'log', but the Y axis still looks linear. How do I solve this?
I am using MATLAB R2019a. The code I'm using is attached below. Thank you in advance.
0 件のコメント
採用された回答
Walter Roberson
2021 年 7 月 19 日
No, log is working correctly
Linear:
Log:
For the log view, compare the distance between 0.6 and 0.65 (bottom) to the distance between 1.05 and 1.1 (top). Both are a distance of 0.05, but the bottom is obviously further apart, as would be expected for log scale.
If this is not sufficiently clear, then use ylim([0.25 1.1]) for the two modes, and you will see for log that the data is crowded into the top
0 件のコメント
その他の回答 (1 件)
Chunru
2021 年 7 月 19 日
The yaxis is indeed in log scale. However, the ylim is in a small range as set by ylim ([0.6 1.1]) so it looks approximately linear.
To verify the log scale more clearly, you can set, for example, the ylim as:
ylim ([0.2 2])
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!