Uniformisation of color scale in different subplots with different limits

4 views (last 30 days)
I have the following plot:
x=(1:10)';
y=(2:2:20)'
for k=1:10
for r=1:10
z1(k,r)=(5*k)+(4*r)+5;
z2(k,r)=(5*k)-(4*r)-5;
end
end
subplot(1,2,1)
surf(x,y,z1)
colorbar
subplot(1,2,2)
surf(x,y,z2)
colorbar
Now, the question is: How do I define a single color bar with unique and common maximum and minimum values (e.g. by fixing the upper and lower limits, as we can do it for the axis)? Thanks for your help and best regards.

Answers (0)

Community Treasure Hunt

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

Start Hunting!