我在这里提供了其他问题
plt.gca().get_xaxis().get_major_formatter().set_useOffset(False)
Run Code Online (Sandbox Code Playgroud)
作为一种消除当前图上轴偏移的方法,但默认情况下有没有办法做到这一点?我在matplotlibrc文件中看不到任何看似有用的内容.
Chr*_*oph 11
2013axes.formatter.useoffset
年,添加了一个名为boolean matplotlibrc的参数,可以关闭偏移量.
例如这样:
import matplotlib as mpl
mpl.rcParams['axes.formatter.useoffset'] = False
Run Code Online (Sandbox Code Playgroud)
不,没有办法做到这一点.它在第ticker.py
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)
Run Code Online (Sandbox Code Playgroud)
作为默认参数值.所以默认是True
.
当然,您可以修改源.
归档时间: |
|
查看次数: |
4547 次 |
最近记录: |