log-log plot explained
조회 수: 6 (최근 30일)
이전 댓글 표시
How can do we produce a log-log visualization for the following data set?
y=[0.6280 0.6554 0.6760 0.6877];
x=[0.27 0.14 0.07 0.04];
figure(1)
loglog(x,y)
An explanation would be great too. Thanks
댓글 수: 0
채택된 답변
dpb
2020년 2월 23일
편집: dpb
2020년 2월 23일
You have created such...what's the problem?
Probably the issue is that your data don't cover a sufficient range in either x or y that the effect of a logarithmic axis is obvious; there is really not much point in using log axes unless data cover many orders of magnitude; otherwise just linear is clearer.
The only possible reason I can think of for such with data such as you've given would be if there were known to be some reason the two are somehow expected to be related by such...but you've given zero context so that's purely conjecture.
If you change the x-,y-limits from the very narrow range that are the default autoscaling, perhaps the nature of the logarithmic axes will be more apparent--
xlim([0.01 1])
ylim([0.4 1])
results in
Oh! One other thing...given that you've given the x data in decreasing order and ML will always plot by default the axes in increasing order, maybe you'd prefer
hAx=gca;
hAx.XDir='reverse';
that will put the larger values to the left instead of right.
댓글 수: 1
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!