How to change contour level in different range?

113 visualizaciones (últimos 30 días)
Kim Je Young
Kim Je Young el 15 de Jul. de 2019
Comentada: FNU Dhanraj el 1 de Sept. de 2021
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

Respuesta aceptada

KSSV
KSSV el 15 de Jul. de 2019
[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 comentarios
Omar Dominguez
Omar Dominguez el 16 de Abr. de 2021
Thank you the solution is perfect!
\
FNU Dhanraj
FNU Dhanraj el 1 de Sept. de 2021
Is there a final code that works well for BSFC Map?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by