title: Matplotlib contour map colorbar
body: <p>I am plotting my data into a contour map. The computations work on the translated values, so I need to put it back to its original value. On the fourth line of the code, is the re-translation process.
  However, when I plotted it the colorbar shows the relative values, and just a note of the shift value at the top of the color bar. It is just weird that I checked the matrix values, and it contains the original values.</p>
  
  <p><a href="https://i.stack.imgur.com/sqMRe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sqMRe.png" alt="enter image description here"></a></p>
  
  <p>How can I show the colorbar, with the original values displayed? </p>
  
  <pre><code>fig=plt.figure()
  v=np.linspace(-180,180,25)
  x,y = np.meshgrid(v,v)
  z = np.add(z,-shift)
  z = z.reshape(25,25).T 
  plt.contourf(x,y,z,25)
  fig.suptitle(AA(prefix)+' Input Data Contour Map')
  plt.xlabel('$\phi$ (deg)')
  plt.ylabel('$\psi$ (deg)')
  plt.xticks(np.arange(-180, 181, 30))
  plt.yticks(np.arange(-180, 181, 30))                                
  plt.colorbar()
  </code></pre>
  
  <p>UPDATE: I used set_ticklabels() for a temporary fix, where <code>labels</code> is a list of custom labels. </p>
  
  <p>But I am still looking for a better way to solve this problem.</p>
  
  <pre><code>plt.colorbar().set_ticklabels(labels)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/IsZZ3.png" rel="nofollow noreferrer">updated contour map</a></p>