title: Color contour different than pcolor
body: <p>I am using pcolor together with contour lines. However, the value of the lines can not be identified from the plot, as can be seen in the following picture.</p>
  
  <pre><code>[x y 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');
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/AueIu.png" alt="enter image description here"></p>
  
  <p>I would rather want the pcolor to be in gray values and the contour lines in colors. However then I need a legend for the contour lines as well.</p>
  
  <p>EDIT:
  It works somehow by combining two colormaps, but then the colorbar shows both, which is not what I want. I would rather want to have a colorbar which includes the same contour lines as the plot.</p>
  
  <pre><code>[x y 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');
  </code></pre>
  
  <p>EDIT:
  The colorbar can be corrected with</p>
  
  <pre><code>set(hcb, 'Ylim', [0 1]);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/pe3GM.png" alt="enter image description here"></p>