I am trying to compare plots that I create by matlab imagesc, and hence need the color limits to be identical to the higher one.
I tried digging, but couldn't find an easy way to do that, or at least figure out the limits without opening the colormap editor.
Thanks much for any help!
Alon.
You can set the limits of the color-scale using caxis
img1 = randn(100);
img2 = rand(100);
%# find global min/max
clim(1) = min(min(img1(:)),min(img2(:)));
clim(2) = max(max(img1(:)),max(img2(:)));
figure
ah1 = axes;
imagesc(img1)
caxis(ah1,clim)
%# show the other figure set the same limits to colormap
figure
ah2 = axes
imagesc(img2);
caxis(ah2,clim)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With