如何更改matplotlib轴,使其不以科学计数法显示? [英] How to change matplotlib axes so that that it does not display in scientific notation?

查看:1131
本文介绍了如何更改matplotlib轴,使其不以科学计数法显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改matplotlib轴,使其不以科学计数法显示? (即在这种情况下显示626.70 ... 626.77) 我尝试通过执行ax.xaxis.set_ticks(np.arange(626.720, 626.727, 0.001))来更改x刻度,但是轴都塞在了左侧.

How to change matplotlib axes so that that it does not display in scientific notation? (i.e. displaying 626.70 ... 626.77 in this case) I tried changing the x ticks by doing ax.xaxis.set_ticks(np.arange(626.720, 626.727, 0.001)), but the axes is all crammed on the left hand side.

谢谢.

推荐答案

x_formatter = matplotlib.ticker.ScalarFormatter(useOffset=False)
x_formatter.set_scientific(False)
ax.xaxis.set_major_formatter(x_formatter)

这篇关于如何更改matplotlib轴,使其不以科学计数法显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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