One plot line is messing up the two other plot lines/points

My second plot() command is messing up the other two plot() commands from displaying properly.

답변 (1개)

In your second plot, the Y axis limits are 0 and 4. Your data points for your first and third lines all have Y coordinates in that interval.
In your first plot, note that the Y axis has a little "x10^5" above it. That means the Y axis limits are 0 and 1200000. The data points from your second line span that range. The points from your first and third lines only take up a very small portion of that range, meaning those lines are essentially indistinguishable from the line Y = 0.
As an analogy, if you had $1.2 million, would you care about spending an extra $4? Or would that be something where you'd say "Sure, whatever, that's small change."
This is not a bug. This is "Your data spans too wide a range to show them both on a linear Y axis plot and see the fine details of all the lines."
You could try setting the Y axis to logarithmic scale using semilogy instead of plot. Note that straight lines (linear data) don't appear straight in log scale.
x = 1:100;
plot(x, x)
title('Linear Y scale')
figure
semilogy(x, x)
title('Logarithmetic Y scale')

댓글 수: 1

Thank you so much this allowed me to realize I made an error earlier in the code where I forgot to put a *1e-3 this made my data to scale.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2025년 9월 22일

댓글:

2025년 9월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by