title: modifying tick numbering in colorbar
body: <p>Hi I'm trying to change the numbering on colorbar my code gives me an unexpected number on colorbar (+1.552, numbers are correct I just dont understand the format) . My graph is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/d9UBt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d9UBt.png" alt="enter image description here"></a></p>
  
  <p>I want to format those ticks on color bar as 1.5, 1.52,1.54 etc.
  The code that Im using is as follows:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib
  matplotlib.rcParams['text.usetex'] = True
  matplotlib.rcParams['text.latex.unicode'] = True
  
  with open("psi_newdata.dat") as f:
      data = f.read()
  
  data = data.split('\n')
  cm = plt.cm.get_cmap('RdYlBu')
  x = [float(row.split('\t')[12]) for row in data]
  y = [float(row.split('\t')[14]) for row in data]
  z = [float(row.split('\t')[8])/1000.0 for row in data]
  
  cm = plt.cm.get_cmap('YlGnBu')
  fig, ax = plt.subplots()
  ax.set_yticks([0.1224,0.1172], minor=True)
  ax.yaxis.grid(True, which='minor')
  
  sc = ax.scatter(x, y, c=z,cmap=cm)
  cbar = plt.colorbar(sc)
  plt.xlabel(r'$\displaystyle M_{\tilde{\nu}_R}$\ [GeV]')
  plt.ylabel(r'$\displaystyle\Omega h^2$')
  cbar.set_label(r"$\displaystyle M_{Z^{'}}$\ [TeV]")
  plt.show()
  </code></pre>