title: Dynamic (or forced) scaling of ColorFunction
body: <p>Reading <a href="https://stackoverflow.com/questions/5753508/custom-colorfunction-colordata-in-arrayplot-and-similar-functions">this question</a> on importing ColorData from matlab, I was wondering if there is a way to change the range of values over which the ColorFunction is scaled. That was probably not entirely clear, so let me show with a figure from matlab (the same example as in the previous question is used)</p>
  
  <p><img src="https://i.stack.imgur.com/TX6kN.png" alt="enter image description here"></p>
  
  <p>The plot on the left is the original, with the <code>ColorData</code> mapped to the data values between <code>-1</code> and <code>1</code>. Now, I can easily set it to be mapped to the data values between <code>0</code> and <code>1</code>, the result being that all values less than <code>0</code> are assigned blue color (lowest in the colormap). <code>PlotRange</code> is the closest function, and using <code>ClippingStyle</code> in addition to that produces a similar figure. However, it doesn't re-scale the ColorData to map to the plot range.</p>
  
  <p>How can I do this in Mathematica? </p>
  
  <p>BTW, to insert colorbars using Mathematica, you can look at this <a href="http://www.walkingrandomly.com/?p=24" rel="nofollow noreferrer">function</a></p>