1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| load clown
% Project Data to the different planes.
h(1) = axes('position',[0.6 0.1 0.4 0.4]);
h(1) = image(X);
h(2) = axes('position',[0.1 0.1 0.4 0.4]);
h(2) = image(X);
% Build a colormap that consists of three separate
% colormaps.
cmapX = jet(32);
cmapY = gray(32);
cmap = [cmapX;cmapY];
colormap(cmap)
xmin = min(X(:));
xmax = max(X(:));
% CDX ranges from 1 to 32.
cdx = min(32,round(31*(X-xmin)/(xmax-xmin))+1);
% CDY ranges from 33 to 64.
cdy = cdx+32;
% Update the CDatas.
set(h(2),'CData',cdx)
set(h(1),'CData',cdy)
% Change CLim (Color Limits) so that it spans all the CDatas
caxis([min(cdx(:)) max(cdz(:))]) |
Partager