title: How to set the color scale in contourf function in MATLAB with arbitrary maximum and minimum values?
body: <p>A simple question. 
  Is there anyway to tell the Matlab function "contourf", to scale the colors with my given values (and not the dataset's values) ?
  I know that you can call the function simply by </p>
  
  <pre><code>contourf(x,y,Data, v) 
  </code></pre>
  
  <p>and setting the range in the v vector, but my problem is that Matlab automatically checks whether or not the specified values in the v vector does actually exist in the Data? If they don't exist, then it automatically rescales the color range back to the maximum and minimum available in the dataset. </p>
  
  <p>For instance, if </p>
  
  <pre><code>Data =[0 1 2; 3 4 5; 6 7 8]; 
  v=-10:1:10;
  </code></pre>
  
  <p>then when I call </p>
  
  <pre><code>contourf(x,y,Data,v) 
  </code></pre>
  
  <p>the colormap shown scales itself with </p>
  
  <pre><code>v=[0:8];
  </code></pre>
  
  <p>The reason I am asking for this is that I would like to several contour plots for various datasets, but I need to always have the same colorcode associated with the maximum/minimums that might not be necessarily in the current data array passed to the contourf function. </p>
  
  <p>I hope I was clear enough. </p>