x1 = 1:10;
y1 = 1:20;
[x3,y3] = meshgrid(x1,y1);
Temp = peaks(20);
Temp = Temp(:,1:10);
x2 = linspace(0,10.5,100);
Temp2 = interp1(1:10,Temp',x2,'nearest')';
ax(1) = subplot(2,2,1);
imagesc(x1,y1,Temp);
title('imagesc(Temp)');
hold on;
scatter(x3(:), y3(:), [], Temp(:), 'filled', 'markeredgecolor', 'k');
set(gca, 'ydir', 'normal');
ax(2) = subplot(2,2,2);
pcolor(x1,y1,Temp);
shading flat;
title('pcolor(Temp)');
hold on;
scatter(x3(:), y3(:), [], Temp(:), 'filled', 'markeredgecolor', 'k');
set(gca, 'ydir', 'normal');
ax(3) = subplot(2,2,3);
contourf(x1,y1,Temp,50);
title('contourf(Temp)');
hold on;
scatter(x3(:), y3(:), [], Temp(:), 'filled', 'markeredgecolor', 'k');
ax(4) = subplot(2,2,4);
contourf(x2, y1, Temp2,50);
title('contourf(Temp2)');
hold on;
scatter(x3(:), y3(:), [], Temp(:), 'filled', 'markeredgecolor', 'k');
set(ax, 'clim', [-5 7], 'xlim', [0.5 10.5], 'ylim', [0.5 20.5]);
0 Comments
Sign in to comment.