[英]Python: change labels of a plot using matplotlib
您需要此FormatStrFormatter('%.2e')
由于您没有发布整个脚本,因此我仅向您显示一个示例:
如果我们从matplolib中获取此演示
只需将majorFormatter = FormatStrFormatter('%d')
更改为我之前显示的内容,您就会看到
您只需将主轴重新格式化为:
ax.xaxis.set_major_formatter(FormatStrFormatter('%.2e'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.