I would like to put contour plots of two datasets on the same axes with the same colorbar. The X and Y ranges of the data do not overlap but are physically adjacent.
Here's a simplified example of two such contourf plots which I'd like to combine on the same axes:
%generate 1st sample dataset
[x1,y1]=meshgrid(-3:3);
v1=peaks(x1,y1)
%generate 2nd sample dataset & move it so it is physically adjacent to
%1st dataset
[x2,y2]=meshgrid(-4:4);
v2=peaks(x2,y2)
x2=8+x2;
figure(1)
contourf(x1,y1,v1)
colormap(jet)
colorbar('EastOutside')
xlabel('x (mm)')
ylabel('y (mm)')
figure(2)
contourf(x2,y2,v2)
colormap(jet)
colorbar('EastOutside')
xlabel('x (mm)')
ylabel('y (mm)')
This produces the following plots
I tried to put the two sample datasets on the same axes using the following:
figure(3)
contourf(x1,y1,v1)
colormap(jet)
hold on
contourf(x2,y2,v2)
colormap(jet)
hold off
Using the typical "hold on" didn't work... suggestions??