matplotlib默认删除轴标签偏移 [英] matplotlib remove axis label offset by default

查看:101
本文介绍了matplotlib默认删除轴标签偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里还阅读了其他问题

I've read other questions here offering

plt.gca().get_xaxis().get_major_formatter().set_useOffset(False)

作为删除当前绘图上的轴偏移的一种方法,但是默认情况下有什么方法可以执行此操作吗?我在matplotlibrc文件中看不到任何有帮助的东西.

as a way to remove axis offsets on the current plot, but is there any way to do this by default? I don't see anything in the matplotlibrc file that seems helpful.

推荐答案

不,没有办法.它在ticker.py的源文件的第353行中定义:

No, there is no way to do it. It is defined in the source file of ticker.py, line 353:

def __init__(self, useOffset=True, useMathText=None, useLocale=None):
    # useOffset allows plotting small data ranges with large offsets: for
    # example: [1+1e-9,1+2e-9,1+3e-9] useMathText will render the offset
    # and scientific notation in mathtext

    self.set_useOffset(useOffset)

作为默认参数值.因此,默认值为True.

as a default parameter values. So the default is True.

您当然可以修改源.

这篇关于matplotlib默认删除轴标签偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆