title: How can I use different colors for contours in MATLAB?
body: <p><a href="https://i.stack.imgur.com/IjIQz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IjIQz.png" alt="Composite Figure"></a>I want that each successive contour is plotted with a different color or to use a colormap for the contour plot. Right now all the contours are being plotted in white. I tried to change the color of the contours but all I could do was to color all of them black by using <code>'k'</code> in the <code>contour()</code> function.</p>
  
  <p>P.S> I'm plotting this over another <code>pcolor()</code> figure (which has a different colormap for itself) using <code>hold on</code>. </p>
  
  <p>Here is some part of the plotting code :</p>
  
  <pre><code>grid_x = 20:0.25:160;
  grid_y = 30:-0.25:-10;
  
  grid_x_sph = 20:2.5:160;
  grid_y_sph =  30:-2.5:-10;
  
  grid_lon = 20:1:160;
  grid_lat = 30:-1:-10;
  
  % grid is my struct containing other structs with data over a region 
      wave_data = grid.olr.avg(1).mjo; 
      sph_data = grid.avg.sph(1).mjo;
      u_data = grid.avg.u(1).mjo;
      v_data = grid.avg.v(1).mjo;
  
  
  
  figure(13);
  pcolor(grid_x,grid_y,wave_data'); shading interp; colormap(cmap3); hold on; colorbar;
  [imxx,c]= contour(grid_x_sph,grid_y_sph,sph_data',8); 
  quiver(grid_lon(1:3:end),grid_lat(1:3:end),u_data(1:3:end,1:3:end)',v_data(1:3:end,1:3:end)','k'); hold on;
  xlim([20 160]);
  ylim([-10 30]);
  caxis([-7 5]);
  load coast; hold on;
  plot(long,lat,'k');
  plot(long+360,lat,'k');
  ylabel('LATITUDE');
  title('MJO');
  </code></pre>