Link ranges in a contour plot comparison

1 次查看(过去 30 天)
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