title: PyPlot Scatter Plot - Logarithmic Color Scale - How To Set Color Bar Label Format
body: <p>I am making a scatter plot in matplotlib with logarithmic color scaling, which is working fine, see attached plot. My problem is, I would like to have the x-tick labels on the r.h.s. of the color bar to be in float format, rather than scientific notation. Interestingly, this works only for <em>some</em> of the labels.</p>
  <p>I have my data <em>x</em>, <em>y</em> for the scatter plot and the <em>weights</em> which specify the colors.
  This is my code:</p>
  <pre><code>fig = plt.figure(dpi=200)
  
  # Plot data, this is the relevant part:
  sc = plt.scatter(x, y, c=weights, cmap='rainbow', s=20, alpha=0.5,
                   norm=mpl.colors.LogNorm(vmin=0.3, vmax=3))
  
  cbar = fig.colorbar(sc, format='%.1f', label='$T_{IDL} / T_{Py}$')  # format arg. supposed to do what I want
  print(cbar.get_ticks()) # For debugging
  
  # Plot dashed line:
  xmin, xmax = plt.gca().get_xlim()
  const = np.linspace(xmin, xmax, 500)
  plt.plot(const, const, linestyle='--', color='black', alpha=0.3)
  
  # Add titles and axis labels:
  fig.suptitle(suptitle)
  plt.title(f'{len(amp_py_cmn)} Common Flares -- Duration Ratio: Mean {np.mean(dur_ratio):.2f},'
            f' St.Dev. {np.std(dur_ratio):.2f}',
            fontsize=7)
  
  plt.xlabel('$A_{Py}$')
  plt.ylabel('$A_{IDL}$')
  
  # Save figure and show:
  fig.savefig(f'{savePath}/{suptitle}.pdf')
  plt.show()
  </code></pre>
  <p>This is the resulting Plot:</p>
  <p><a href="https://i.stack.imgur.com/ELZQw.png" rel="nofollow noreferrer">Scatter Plot</a></p>
  <p>I added the call of cbar.get_ticks() while debugging, and interestingly the output gives</p>
  <pre><code>[1.]
  </code></pre>
  <p>which corresponds to the only label that looks according to my wishes. So the question is, where do the other labels come from, and how can I format them?
  Thanks!</p>