How to change contour level in different range?

119 ビュー (過去 30 日間)
Kim Je Young
Kim Je Young 2019 年 7 月 15 日
コメント済み: FNU Dhanraj 2021 年 9 月 1 日
Hello, I am new to Matlab.
Currently, I am plotting BSFC map using contour function.
I wanna set different levelstep instead of fixed value.
Due to fixed LevelStep, the below graph looks so ugly.
For levelList<300, I would like to set levelStep=50, and for LevelList>300, I would like to set LevelStep as 5.
Is there any way to control Level Step (Isoline) in different LevelList?
FYI, here is my code.
Thank you for your help in advance.
rawdata=xlsread('BSFC_NA2.xlsx','Sheet1','A1:I88');
RPM =rawdata(:,1);
Torque = rawdata(:,2);
bsfc = rawdata(:,3);
R100 = rawdata(:,4);
T100 = rawdata(:,5);
RPM1 =rawdata(:,6);
Torque1 = rawdata(:,7);
bsfc1 = rawdata(:,8);
% Create gridded data:
Rpmgrid = linspace(1000,max(RPM),10);
Torquegrid = linspace(0,90,10);
BSFCgrid = gridfit(RPM,Torque,bsfc,Rpmgrid,Torquegrid);
[c1,h1]=contour(Rpmgrid,Torquegrid,BSFCgrid,'LevelStep',5,'ShowText','on'); drawnow
set(h1.EdgePrims(h1.LevelList>0 ), 'LineStyle', 'dotted');
hold on
k5=plot(R100,T100,'r','LineWidth',3)
hold on
untitled.jpg

採用された回答

KSSV
KSSV 2019 年 7 月 15 日
[X,Y,Z] = peaks(100) ;
figure
hold on
contour(X,Y,Z,'LevelList',-6:0.2:4) % levels with difference 0.2 for till 4
contour(X,Y,Z,'LevelList',4:0.5:8) % levels with difference 0.5 from 4 to 8
  3 件のコメント
Omar Dominguez
Omar Dominguez 2021 年 4 月 16 日
Thank you the solution is perfect!
\
FNU Dhanraj
FNU Dhanraj 2021 年 9 月 1 日
Is there a final code that works well for BSFC Map?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by