Line incorrectly connects data points in a loglog plot

조회 수: 10 (최근 30일)
Sim
Sim 2022년 8월 16일
답변: Sim 2022년 8월 16일
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일
a = sortrows(a,[1 2])
loglog(a(:,1),a(:,2))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Log Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by