필터 지우기
필터 지우기

How can I equally space a contour level

조회 수: 8 (최근 30일)
University Glasgow
University Glasgow 2023년 3월 19일
댓글: John D'Errico 2023년 3월 19일
Please can someone help with equally spacing a contour. I tried different approach but couldn't work. I have attached the data and the figure I got. I want the contour level above and below the second red line to be equally space. This is what I tried.
xi = linspace(-0.3, 0.3, 201);
u = linspace(0, 3, 201);
contourf(u, xi, Dv1(:, :)/100000, [min(min(Dv1))/100000:0.0002:-0.00006 0.0001:0.004:0.04, 0.001, 0.0016, 0.00055, 0.00069, 0.0002 0.0015:0.0004:0.0042 0.0043:0.0005:0.02 0.013 0.05:0.05:0.5 0.074 0.87 0.68 0.063 0.073, 1.35 1.75, 2.56 1.1:1:9 10:10:max(max(Dv1))/100000] );
a = colorbar;
Label = ylabel(a,'D_v','FontSize',12,'Rotation',90);
hColourbar.Label.Position(1) = 3;
hold on
[c,h]= contour(u,xi,M1,[-2,0,2], '-r');
xlabel('u')
ylabel('\xi (Pa)')
hold off
  댓글 수: 5
University Glasgow
University Glasgow 2023년 3월 19일
Thank you John and DGM for your response.
For instance, if I plot 10 contours between min(min(Dv1))/100000 and max(max(Dv1))/100000, I got the attached second figure.
I'm finding difficult to add equally-spaced contours above and below the solid red line that is planar to the x-axis. I don't know if it is possible to do that. If it is not possible, what possible way can one do this please?
John D'Errico
John D'Errico 2023년 3월 19일
if is it not possible, then how would we tell you how to do something that is impossible? Irresistable force, please meet immovable object.
A region in the plane where there are no contours drawn means you have a region where the surface is nearly perfectly flat over that entire region. If the surface is truy perfectly flat, then there are NO contour lines that cross through that region. But if it changes by even the slightest amount, then in theory, you could draw a contour line. But in that area, the contour lines would have a tiny difference in z-value. If you allow contour to draw contours at constant, then you will have a problem.
Remember that a contour line is the set of all points such that z(x,y)==z0, thus some specified constant.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by