How to change font size of the scientific notation in matplotlib?

You want to change the fontsize of the offset_text from the yaxis. You can do that with this line:

ax.yaxis.get_offset_text().set_fontsize(24)

Or equivalently:

ax.yaxis.offsetText.set_fontsize(24)

enter image description here

Leave a Comment