title: Changing color range 3d plot Matplotlib
body: <p>I am trying to make a 3d plot but the color range is so small that it only covers a small portion of the values that the z-axis can have. How do I fix this?</p>
  
  <p>I attach the code and the image that I get:</p>
  
  <pre><code>fig = plt.figure()
  ax = fig.gca(projection='3d')
  surf = ax.plot_surface(B , ENERGY, result_plot, cmap=cm.Spectral_r , linewidth=0.0 ,antialiased =False)
  
  colorbar( surf, shrink=0.5, aspect=3)
  
  
  ax.view_init(30, 45)
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/jcmS8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jcmS8.png" alt="3d plot"></a></p>