I am trying to combine multiple contour plots on the same figure in MATLAB to obtain a region satisfying common constraints with lines for one of the criteria in passing region.

2 views (last 30 days)
I am using below srcipt which is giving me a combine plot . Now I also want to draw the lines in a region satisfying common constraints for one of my criteria (D5 in below case which is not normalised and have values for it in a range of - 5000 to +5000). all other parameters i.e. D1,D2,D3 and D4 are normalised. Could you please help me with this?
tlt8 =['Combined Map']; figure(8); figure(8); hold all;xlabel('attached inertia [in-lb-sec^2]') figure(8); hold all;ylabel('inertia at front end [in-lb-sec^2]') figure(8); hold all;title ('Valid inertia envelop') cIndx = (D1>1).*(D2>1).*(D3>1).*(D4>1).*(D5>0);
[C1,h1]= contourf(X,Y,D1); hText=clabel(C1,h1,'LabelSpacing',108,'color','b');
hold on;
[C2,h2]= contourf(X,Y,D2); hText=clabel(C2,h2,'LabelSpacing',108,'color','k');
hold on;
[C3,h3]= contourf(X,Y,D3); hText=clabel(C3,h3,'LabelSpacing',108,'color','k');
hold on;
[C4,h4]= contourf(X,Y,D4); hText=clabel(C4,h4,'LabelSpacing',108,'color','k');
hold on;
[C5,h5]= contourf(X,Y,D5); hText=clabel(C5,h5,'LabelSpacing',108,'color','k');
[cc,hc]=contourf(X,Y,cIndx,1);
hcPatches=findobj(hc,'Type','Patch');
for pIndx=1:length(hcPatches)
y=get(hcPatches(pIndx),'YData');
%set the common pass area to be green and if(get(hcPatches(pIndx),'Userdata')~=0) set(hcPatches(pIndx),'FaceColor',[0 1 0]); else %Make the fail area invisible % set(hcPatches(pIndx),'Visible','off'); set(hcPatches(pIndx),'FaceColor',[1 0 0]);
end end

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!