title: MATLAB Colorbar - Same colors, scaled values
body: <p>Consider the following example:</p>
  
  <pre><code>[ X, Y, Z ] = peaks( 30 );
  figure( 100 );
  surfc( X, Y, Z );
  zlabel( 'Absolute Values' );
  colormap jet;
  c = colorbar( 'Location', 'EastOutside' );
  ylabel( c, 'Relative Values' );
  </code></pre>
  
  <p>The output looks as follows:
  <a href="https://i.stack.imgur.com/VF1Zn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VF1Zn.png" alt="MATLAB Colorbar - Absolute Scaling"></a></p>
  
  <p>How can I <strong>scale the ticks on the colorbar, i.e. scale the c-axis</strong> (e.g. divide the values by 100):</p>
  
  <ul>
  <li>without changing the z values and colors on the plot</li>
  <li>without changing the colors on the colorbar</li>
  <li>without changing the relation between the colors on the plot, the colors on the colorbar and the z values of the plot</li>
  <li>while still using the full range of the colorbar</li>
  </ul>
  
  <p>In the picture above, I would like to scale the c-axis such that it shows this values for the related z:</p>
  
  <pre><code>z | c-axis
  ----------
  8 | 8/100
  6 | 6/100
  4 | 4/100
  . | ...
  </code></pre>
  
  <p>The function <a href="https://www.mathworks.com/help/matlab/ref/caxis.html" rel="nofollow noreferrer"><code>caxis</code></a>, as I understand it, is not suited here, as it would just show the colors for a subsection of the z-axis and not for the whole z-axis.</p>
  
  <p>Bonus question: How could one scale the color mapping and the colorbar as a function of X, Y and/or Z?</p>