我有以下范围的numpy数据(usec时间戳的增量):
array([ 4.312, 4.317, 4.316, 4.32 , 4.316, 4.316, 4.319, 4.317,
4.317, 4.316, 4.318, 4.316, 4.318, 4.316, 4.318, 4.317,
4.317, 4.317, 4.316, 4.317, 4.318, 4.316, 4.318, 4.316,
4.318, 4.316, 4.317, 4.317, 4.318, 4.316, 4.317, 4.317,
4.317, 4.317, 4.317, 4.316, 4.319, 4.315, 4.319, 4.315,
4.319, 4.315, 4.316, 4.319, 4.317, 4.317, 4.317, 4.318,
4.315, 4.317, 4.317, 4.317, 4.319, 4.314, 4.32 , 4.315,
4.317, 4.318, 4.315, 4.318, 4.317, 4.317, 4.317, 4.316,
4.317, 4.318, 4.317, 4.317, 4.317, 4.315, 4.319, 4.317,
4.315, 4.319, 4.316, 4.318, 4.318, 4.315, 4.318, 4.317,
4.317, 4.321])
当我使用matplotlib.pyplot绘图时:
import matplotlib.pyplot as plt
plt.plot( deltas )
plt.show()
我得到了下面的情节。为什么Y轴以这种方式缩放?如何将Y轴标记为数据,而不是数据的偏移?有时图是“+4.nnn”,有时不是(取决于数据范围?).
“奇怪地”策划:
“正确”绘制:
3条答案
按热度按时间wvyml7n51#
将useOffset设置为False:
qacovj5a2#
This answer建议禁用偏移量作为全局设置,这对我很有效:
qni6mghb3#
您还可以使用
不过我还是更喜欢@HYRY的回答。