how can i contour level control use with 'plot'
조회 수: 2 (최근 30일)
이전 댓글 표시
I want Contour level control in my code
I know how to control the basic contour level,
I don't know contour level control with 'plot' and 'fit' code
how to 'Contour' level control? please teach me (Make the contour spacing more detailed.)
and i want specific number of contour values can be printed out(contour <0 or contour>0)
Please explain it with a picture
x=[1200 1200 1200 1200 1100 1100 1100 1100 1000 1000 1000 1000 900 900 900 900]';
y=[-2 -1 0 1 -2 -1 0 1 -2 -1 0 1 -2 -1 0 1]';
z=[0.577605826 0.488558387 0.45273093 0.478115298 0.547461689 0.460354119 0.420345944 0.43529964 0.497821842 0.370804822 0.305371971 0.318197107 0.416543949 0.372316357 0.339559983 0.319807786]';
f = fit( [x, y], z, 'cubicinterp' )
ph = plot(f, 'Style', 'Contour');
set(ph, 'Fill', 'off', 'LineColor', 'auto');
grid off;
C = get(ph, 'ContourMatrix');
clabel(C, ph);
댓글 수: 0
채택된 답변
DGM
2021년 12월 3일
편집: DGM
2021년 12월 3일
You can set the LevelList property
x=[1200 1200 1200 1200 1100 1100 1100 1100 1000 1000 1000 1000 900 900 900 900]';
y=[-2 -1 0 1 -2 -1 0 1 -2 -1 0 1 -2 -1 0 1]';
z=[0.577605826 0.488558387 0.45273093 0.478115298 0.547461689 0.460354119 0.420345944 0.43529964 0.497821842 0.370804822 0.305371971 0.318197107 0.416543949 0.372316357 0.339559983 0.319807786]';
f = fit( [x, y], z, 'cubicinterp' );
ph = plot(f, 'Style', 'Contour');
set(ph, 'Fill', 'off', 'LineColor', 'auto');
ph.LevelList = linspace(0.2,0.6,20); % just pick some levels
grid off;
C = get(ph, 'ContourMatrix');
clabel(C, ph);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!