Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I use multiple colormaps?

colormaps
0
Posted

How do I use multiple colormaps?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123