-1

In the following figur, the colorbar does not have a decimal point for some subplots while others have it. I want to make the colorbar units always have a single precision i.e 2.0, 2.5, 4.0 etc. My current snippet doesn't seem to be working:

 cbformat = tt.ScalarFormatter()
 cbformat.set_scientific('%0.1e')
 cbformat.set_powerlimits((0,0))
 cbformat.set_useMathText(True)

and then:

 cbar=plt.colorbar(im, ax =ax[i], format=cbformat)

Figure: enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
wander95
  • 1,298
  • 1
  • 15
  • 22

0 Answers0