Link ranges in a contour plot comparison

조회 수: 1 (최근 30일)
Mustahsan Majeed
Mustahsan Majeed 2014년 10월 31일
편집: Adam 2014년 10월 31일
Hello,
I am trying to link levels in 2 contour plots in one figure. As its easier to compare if the range/level is the same. Attached are two example figures and as you can see there are different ranges for each plot in a figure, which makes it difficult to compare.
I want to link them somehow so that the range for both plots in one figure are same. I hope I was able to explain my question fully.
Thanks, Mustahsan

채택된 답변

Adam
Adam 2014년 10월 31일
편집: Adam 2014년 10월 31일
hLink = linkprop( axesHandles, 'CLim' );
should work I think, if you create an array of the two axes handles in question.
doc linkprop
  댓글 수: 2
Mustahsan Majeed
Mustahsan Majeed 2014년 10월 31일
Following is my code for the function for plotting the comparison. Could you please tell me how to use linkprops in this case:
function plot_cmp2(n_as,M_as,var_h,var_p,var)
var_h(var_h<min(level))=min(level);
var_h(var_h>max(level))=max(level);
var_p(var_p<min(level))=min(level);
var_p(var_p>max(level))=max(level);
h1=subplot(1,2,1)
[c,h1]=contourf(n_as,M_as,var_h);clabel(c,h1,'Color','w');colorbar('north')
label('Engine_speed [rpm]','Torque [Nm]','',[var ' HIL'])
set(gcf, 'Position', [100, 100,800, 500]);
h2=subplot(1,2,2)
[c,h2]=contourf(n_as,M_as,var_p);clabel(c,h2,'Color','w');colorbar('north')
label('Engine_speed [rpm]','Torque [Nm]','',[var ' AVL'])
set(gcf, 'Position', [100, 100,800, 500]);
end
Thanks, Mustahsan
Mustahsan Majeed
Mustahsan Majeed 2014년 10월 31일
I got it.
Thank you very much. It works now!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by