MATLAB图:奇怪的水平线 [英] MATLAB plot: strange horizontal lines
本文介绍了MATLAB图:奇怪的水平线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试绘制theta与omega的曲线图(x轴为theta,y轴为ω),除了似乎偏离-pi的水平线外,我生成的图看起来还可以到pi.有谁知道是什么原因导致这种情况发生,或如何将其删除?
I am trying to produce a plot of theta vs. omega (theta on the x-axis, omega on the y-axis) and the plot I am generating looks ok except for stray horizontal lines that seem to span from -pi to pi. Does anyone know what causes this to happen, or how to remove them?
谢谢
推荐答案
除非您提供代码,否则我们将无法提供良好的答案.这些方法可能会有所帮助,但是:
Unless you provide your code, we won't be able to provide the good answer. These methods might help, though:
- 如果绘图上有足够的点,并且在绘图中它们很密集,而在不需要的线上则较不密集,则可以尝试将
'bx'
插入到plot
中,因此该图形将仅包含可能会使看不见的线保留剩余的图形. - 您可以手动或通过添加诸如
A(A>2)=NaN
之类的命令将矩阵中所有不需要的点转换为NaN.
- If there are sufficient points on the plot, and they are dense in the plot and less dense on the unwanted lines, you can try to insert
'bx'
intoplot
, so the graph would consist of only blue crosses that would possibly make lines invisible retaining the remaining graph. - You can convert all the unwanted points in the matrices to NaN either manually or by adding some command like
A(A>2)=NaN
.
这篇关于MATLAB图:奇怪的水平线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文