像 1e-6+6.0459e-1 这样的字符串在 matplotlib 图中的垂直轴标签的上下文中意味着什么?
What does a string like 1e-6+6.0459e-1 mean in the context of a vertical axis label in a matplotlib plot?
我有一个 Python 代码可以给我这样的情节(由 matplotlib 制作):
平均值约为0.6065
然后我改变一个参数,从某个值开始,matplotlib自动在纵轴上添加一个像1e-6+6.0459e-1
这样的字符串:
这是什么意思?
也许在 +6.0459e-1
处有一个“参考”y-value 并且振荡峰峰值约为 5e-6?
表示纵轴上的每个数字y
实际上是y * 10**-6 + 6.0459 * 10**-1
.
换句话说,正弦曲线基本上是平坦的线6.0459 * 10**-1
(a.k.a。0.60459
)有一些加法” 10**-6
数量级的噪声”(正弦曲线),这是一个非常小的数字。
您可以使用 plt.ylim(0.604, 0.605)
.
之类的内容强制使用更清晰的比例
我认为这已记录在 documentation for matplotlib.ticker.ScalarFormatter
:
的“偏移记数法和科学记数法”部分
Offset notation and scientific notation look quite similar at first sight. Both split some information from the formatted tick values and display it at the end of the axis.
- The scientific notation splits up the order of magnitude, i.e. a multiplicative scaling factor, e.g.
1e6
.
- The offset notation separates an additive constant, e.g.
+1e6
. The offset notation label is always prefixed with a +
or -
sign and is thus distinguishable from the order of magnitude label.
因此,在1e-6+6.0459e-1
中:
1e-6
是科学计数法中的数量级
+6.0459e-1
是科学计数法中的偏移量
我有一个 Python 代码可以给我这样的情节(由 matplotlib 制作):
平均值约为0.6065
然后我改变一个参数,从某个值开始,matplotlib自动在纵轴上添加一个像1e-6+6.0459e-1
这样的字符串:
这是什么意思?
也许在 +6.0459e-1
处有一个“参考”y-value 并且振荡峰峰值约为 5e-6?
表示纵轴上的每个数字y
实际上是y * 10**-6 + 6.0459 * 10**-1
.
换句话说,正弦曲线基本上是平坦的线6.0459 * 10**-1
(a.k.a。0.60459
)有一些加法” 10**-6
数量级的噪声”(正弦曲线),这是一个非常小的数字。
您可以使用 plt.ylim(0.604, 0.605)
.
我认为这已记录在 documentation for matplotlib.ticker.ScalarFormatter
:
Offset notation and scientific notation look quite similar at first sight. Both split some information from the formatted tick values and display it at the end of the axis.
- The scientific notation splits up the order of magnitude, i.e. a multiplicative scaling factor, e.g.
1e6
.- The offset notation separates an additive constant, e.g.
+1e6
. The offset notation label is always prefixed with a+
or-
sign and is thus distinguishable from the order of magnitude label.
因此,在1e-6+6.0459e-1
中:
1e-6
是科学计数法中的数量级+6.0459e-1
是科学计数法中的偏移量