I use pcolor along with contour lines. However, the meaning of the lines cannot be identified from the graph, as can be seen in the following figure.
[xy data] = peaks(1000); data = data / max(max(data)); colorDepth = 1000; colormap(jet(colorDepth)); hold on; pcolor(x,y,data); shading flat [C,hfigc] = contour(x, y, data,[0:0.1:1]); set(hfigc, ... 'LineWidth',1.0, ... 'Color', [1 1 1]); hold off; hcb = colorbar('location','EastOutside');

I would prefer pcolor to be in gray values, and contour lines in colors. However, I also need a legend for contour lines.
EDIT: It works somehow by combining two color maps, but then the color bar shows both, which is not what I want. I would prefer to have a color panel that includes the same contour lines as the graph.
[xy data] = peaks(1000); data = data - min(min(data)); data = data / max(max(data)); colorDepth = 1000; hold on; caxis([-1 1]); colormap([gray(colorDepth); jet(colorDepth)]); hplot = pcolor(x,y,data); shading flat [C,hfigc] = contour(x, y, data-1,[-1:0.1:0]); set(hfigc, 'LineWidth',1.0); % set(hfigc, 'Color', [1 1 1]); hold off; hcb = colorbar('location','EastOutside');
EDIT: Color panel can be adjusted with
set(hcb, 'Ylim', [0 1]);
