Line incorrectly connects data points in a loglog plot

Given the array "a.mat" here attached, if I plot it, i.e.
plot(a(:,1),a(:,2))
I get this picture
Instead, if I plot it in a log scale, i.e.
loglog(a(:,1),a(:,2))
I get this picture (it looks like the points are not sorted...)
How to have a smooth curve in the "loglog" plot, where the line connecting the data points does not "jump" back and forth ?

 採用された回答

Sim
Sim 2022 年 8 月 16 日

0 投票

a = sortrows(a,[1 2])
loglog(a(:,1),a(:,2))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLog Plots についてさらに検索

質問済み:

Sim
2022 年 8 月 16 日

回答済み:

Sim
2022 年 8 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by