"Warning: Negative data ignored" for title(), xlabel(), ylabel()
1 次查看(过去 30 天)
显示 更早的评论
When I am plotting using the logarithmic scale, either semilogx() or set(gca,'xscale','log') will cause the title(), xlabel(), and ylabel() to generate Negative data ignored warning. The warning disappears when all of those are commented out or deleted, but a plot without title and labels just doesn't seem right. Anyone can help me with why this is happening and are there any ways to resolve this?
0 个评论
回答(1 个)
Chunru
2021-7-23
There is no problem except for the warning:
x=(-1:.1:10); semilogx(x, cos(x))
xlabel('x')
ylabel('y')
title('test')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!