Hi matplotlib users:
Could you please help me with this?
I have created a map plot and a colorbar. For the colorbar I’ve used the format argument, supplying the following object as a value:
#format the colorbar tick labels
sfmt = ScalarFormatter(useMathText=True)
sfmt.set_powerlimits((-2, 2))
cb = colorbar(format=sfmt)
As you can see on the image below my text from the multiplier is overlapping with a top tick label. I would like to lift it a bit, is there an easy way?
I tried this, but it does not work, since after colorbar()
the toffsetText
does not contain the multiplier yet:
ax = [cb.ax](http://cb.ax)
title = ax.offsetText.get_text()
ax.offsetText.set_text("{0}\n\n\n\n".format(title))
I could, probably increase the width of the colorbar or decrease font size… But I like this width and the font size seems to be very readable.