How do I use multiple colormaps?
Here is an example: % Place a gray PCOLOR of PEAKS and hsv SURF of PEAKS in % the same plot. clf hold off % Set the colormap colormap([gray(30);hsv(30)]) % Generate the data = peaks(30); % Create the Cdata for the PCOLOR and SURFACE plot. % The Cdata for each plot should be contiguous, and % not overlap. This will guarantee that they use % different regions of the colormap. cd1 = z + abs(min(min(z))); cd2 = cd1 + max(max(cd1)) + 1; % Place the PCOLOR P = pcolor(cd1); shading interp % Change the location so that it will be visible when % the SURFACE is drawn set(P,’zdata’, -30*ones(size(get(P,’zdata’)))) hold on % Place the SURFACE plot S = surf(1:30,1:30,z,cd2); % Change the location so that it does not overlap the % PCOLOR %set(S,’zdata’,15+get(S,’zdata’)) % Change the Clim used by AXES set(gca,’clim’,[min(min(cd1)), max(max(cd2))]) % Make sure that the VIEW and AXES limits are correct view(3) axis([1 30 1 30 -30 30]) % Rules that you need to follow when doing this. % % 1) The Cdata v