Link ranges in a contour plot comparison

1 visualización (últimos 30 días)
Mustahsan Majeed
Mustahsan Majeed el 31 de Oct. de 2014
Editada: Adam el 31 de Oct. de 2014
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

Respuesta aceptada

Adam
Adam el 31 de Oct. de 2014
Editada: Adam el 31 de Oct. de 2014
hLink = linkprop( axesHandles, 'CLim' );
should work I think, if you create an array of the two axes handles in question.
doc linkprop
  2 comentarios
Mustahsan Majeed
Mustahsan Majeed el 31 de Oct. de 2014
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 el 31 de Oct. de 2014
I got it.
Thank you very much. It works now!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by