Link ranges in a contour plot comparison

4 ビュー (過去 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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by