为什么matplotlib.pyplot显示隐藏数据的大空间?

时间:2015-11-14 08:18:26

标签: python matplotlib

当我看到matplotlib显示多行时,我感到非常惊讶。

import numpy as np
import matplotlib.pyplot as plt
plt.figure()
rand_len = np.random.rand(500)
rand_space = np.random.rand(500)
last_pos = 0.0
for i in range(len(rand_len)):
    plt.plot([last_pos, last_pos + 10*rand_len[i]], [1,1],'k-',linewidth=3.0)
    last_pos += 10*rand_len[i] + 1000*rand_space[i]
plt.grid()
plt.show()

graph

但是当我增加尺寸时

resized graph

在第一张图片中隐藏了一些点 我明白他们很小。并且matplotlib不应该绘制实线。

也许这种观点的可视化非常困难。我必须看到原始数据或绘制全尺寸图表。 !?

在这种情况下,您建议如何绘制科学数据?

UPDATE1:

此问题仍然存在。 我希望this link可以帮助某人。

1 个答案:

答案 0 :(得分:0)

Eric Firing(efiring)提出了答案:

plt.plot([last_pos, last_pos + 10*rand_len[i]], [1,1],'k-', marker='.')

相反:

plt.plot([last_pos, last_pos + 10*rand_len[i]], [1,1],'k-',linewidth=3.0)

更多信息:https://github.com/matplotlib/matplotlib/issues/5483#issuecomment-156940871