From: Semih on
Hi,
I was having the same problem until I figured it out:

Type

caxis( [a b] )

after your pcolor instruction.
This will change the "color axis" of your figure so that its minimum will have value "a" and its maximum will have value "b".

For example, if in your color scale red corresponds to the highest value and blue corresponds to the lowest value,

caxis( [0 5] ) will set the color axis so that blue means 0 and red means.

Hope this helps.
SD

"Juan" <jpnp(a)hotmail.com> wrote in message <gsct4n$fjh$1(a)fred.mathworks.com>...
> I am making a movie by capturing the figures created using pcolor. However I see that my colorbar changes with each figure therefore it makes it hard to understand what happens.
>
> Is there a way to keep the same scale in the colorbar and not keep it changing. Code is attached below.
>
> Thanks
>
> LNGTH=length(SNW)/625;
> fig=figure;
> set(fig,'DoubleBuffer','on');
> i=1;
> p=1;
> for u=1:1:LNGTH
> h=pcolor(reshape(SNW(i:i+624),25,25));
> shading interp;
> colorbar;
> i=i+625;
> set(h,'EraseMode','xor');
> saveas(gcf,['movie/comp_' num2str(p) '.jpg'], 'jpg');
> p=p+1;
> end