当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python matplotlib EngFormatter.format_eng用法及代码示例

本文简要介绍 python 语言中 matplotlib.ticker.EngFormatter.format_eng 的用法。

用法

format_eng(num)

用工程记数法格式化一个数字,附加一个代表原始数字的 1000 次方的字母。一些例子:

>>> format_eng(0)        # for self.places = 0
'0'
>>> format_eng(1000000)  # for self.places = 1
'1.0 M'
>>> format_eng(-1e-6)  # for self.places = 2
'-1.00 µ'

相关用法


注:本文由纯净天空筛选整理自skytowner.com大神的英文原创作品 matplotlib.ticker.EngFormatter.format_eng。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。