在Matlab的轮廓图中选择特定级别 [英] Pick a specific level in the contour plot on matlab
问题描述
我有这个情节,它是我用来找出等高线图的测试的结果通常在matlab上工作.我试图找出是否有一种方法可以仅绘制其中一条线,而不必绘制第一条线.
I have this plot that I generated as a test of figuring out how contour plots work on matlab in general. I'm trying to figure out if there is a way I can plot just one of the lines but not necessarily the first line.
Matlab用这种方法解释是否这样做:
They way Matlab explains it is if you do:
contour(X,Y,Z,1);
它将绘制其中一条线,但它始终是第一条线,但是对于我的特殊情况,我需要第三条或第四条线.在Matlab中有办法做到这一点吗?
it will plot one of the lines but it's always the first one, but for my particular case I want the 3rd or 4th one. Is there a way to do that in Matlab?
推荐答案
contour(Z,N)
和contour(X,Y,Z,N)
绘制N
等高线,自动选择级别.这不是您想要的不是!
contour(Z,N)
and contour(X,Y,Z,N)
draw N
contour lines, choosing the levels automatically. This is not what you want!
contour(Z,V)
和contour(X,Y,Z,V)
为向量V
中指定的每个级别绘制一条轮廓线.使用contour(Z,[v v])
或contour(X,Y,Z,[v v])
绘制单级v
的轮廓.
contour(Z,V)
and contour(X,Y,Z,V)
draw a contour line for each level specified in vector V
. Use contour(Z,[v v])
or contour(X,Y,Z,[v v])
to draw contours for the single level v
.
建议第3行和第4行的电平为7
和8
,您必须写contour(X,Y,Z,[7 7])
仅绘制第3条线或contour(X,Y,Z,[7 8])
绘制第3和第4条线.
Suggesting the levels of the 3rd and 4th line are 7
and 8
you have to write contour(X,Y,Z,[7 7])
to only plot the 3rd line or contour(X,Y,Z,[7 8])
to plot the 3rd and the 4th line.
这篇关于在Matlab的轮廓图中选择特定级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!