matplotlib命令与格式:tick坐标轴主副刻度设置:
参见:https://matplotlib.org/api/axis_api.html
按固定的数量级缩放轴:
例如,要把y轴缩小100倍(1e2),如y轴坐标100->1.0,代码是这样的:
ax.ticklabel_format(style='sci', scilimits=(2, 2), axis='y')
设置1e2的位置和大小:
ax.get_yaxis().get_offset_text().set(va='bottom', ha='left')
ax.yaxis.get_offset_text().set_fontsize(38)
在图的左上角添加1*10^{-2},注意到会把e^2覆盖掉。
t = ax.text(0.01, 1.05, r'$1\times 10^{-2}$', transform=ax.transAxes, fontsize=30)
t.set_bbox(dict(color='red', alpha=1.0, edgecolor=None))
reference:https://blog.youkuaiyun.com/yh0vlde8vg8ep9vge/article/details/82837198