0

I would like to move the offset text in matplotlib from above the y-axis to besides the y-axis. The following code

import matplotlib.pyplot as plt
fig,ax = plt.subplots()
ax.plot([0,1],[0,1e-6],'o-')
ax.yaxis.set_offset_position('left')
ax.set_xlabel('$x$')
ax.set_ylabel('$y$')
plt.show()

results in this figure: original figure

I am aware of this command

ax.yaxis.set_offset_position('left')

However, it only accepts an option of "left" or "right". Does anyone know how to move the offset text to the position as in the following figure? desired figure

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
Hongcheng Ni
  • 427
  • 1
  • 4
  • 11
  • Relevant: https://stackoverflow.com/questions/45760763/how-to-move-the-y-axis-scale-factor-to-the-position-next-to-the-y-axis-label, https://stackoverflow.com/questions/43718275/colorbar-offsettext-scientific-base-multiplier-move-from-top-to-bottom-of-colo – tmdavison Jan 18 '18 at 12:17
  • Also relevant: https://github.com/matplotlib/matplotlib/issues/4476 – tmdavison Jan 18 '18 at 12:19

0 Answers0