简体   繁体   中英

Move scientific notation exponential to right side of y axis in matplotlib

I have plotted a figure like this 在此处输入图片说明

Now I want to move the scientific notation offset 1e4 to the right of the right y axis, best move it to the upper right of 1.8 label. How can I do this?

This should work:

t = ax.yaxis.get_offset_text()
t.set_x(1.1)

with ax your right axis. However, you cannot change the y position, so if you are not satisfied with it, you can hide the offset text and create it manually at the right position (x,y):

ax.yaxis.get_offset_text().set_visible(False)
text(x, y, "1e4")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM