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' )
Piecewise cubic interpolant: f(x,y) = piecewise cubic surface computed from p Coefficients: p = coefficient structure
ph = plot(f, 'Style', 'Contour');
set(ph, 'Fill', 'off', 'LineColor', 'auto');
grid off;
C = get(ph, 'ContourMatrix');
clabel(C, ph);

 採用された回答

DGM
DGM 2021 年 12 月 3 日
編集済み: DGM 2021 年 12 月 3 日

1 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeContour Plots についてさらに検索

製品

リリース

R2021a

質問済み:

2021 年 12 月 2 日

コメント済み:

2021 年 12 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by