One plot line is messing up the two other plot lines/points
2 次查看(过去 30 天)
显示 更早的评论
My second plot() command is messing up the other two plot() commands from displaying properly.




0 个评论
回答(1 个)
Steven Lord
2025-9-22
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')
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

