你可以使用 ax.yaxis.get_offset_text()
来获取偏移文本。然后你可以在这个 Text
对象上设置大小和颜色。例如:
import matplotlib.pyplot as plt
import numpy as np
fig,ax = plt.subplots()
ax.plot(range(10),np.linspace(0,1e11,10))
offset_text = ax.yaxis.get_offset_text()
offset_text.set_size(20)
offset_text.set_color('red')
plt.show()
