本文整理汇总了Python中histogram.Histogram.asline方法的典型用法代码示例。如果您正苦于以下问题:Python Histogram.asline方法的具体用法?Python Histogram.asline怎么用?Python Histogram.asline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类histogram.Histogram
的用法示例。
在下文中一共展示了Histogram.asline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_asline
# 需要导入模块: from histogram import Histogram [as 别名]
# 或者: from histogram.Histogram import asline [as 别名]
def test_asline(self):
h = Histogram(10,[0,10])
h.data = np.array([1,2,3,4,5,0,1,2,9,0],dtype=np.int64)
x,y,ext = h.asline()
assert_array_almost_equal(x,[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10])
assert_array_almost_equal(y,[1,1,2,2,3,3,4,4,5,5,0,0,1,1,2,2,9,9,0, 0])
assert_array_almost_equal(ext,[0,10,0,9])
h = Histogram(10,[0,10])
h.data = np.array([0,2,3,4,5,0,1,2,9,0],dtype=np.int64)
x,y,ext = h.asline()
assert_array_almost_equal(x,[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10])
assert_array_almost_equal(y,[0,0,2,2,3,3,4,4,5,5,0,0,1,1,2,2,9,9,0, 0])
assert_array_almost_equal(ext,[0,10,0,9])
h = Histogram(10,[0,10])
h.data = np.array([0,2,-4,4,5,0,1,2,9,0],dtype=np.int64)
x,y,ext = h.asline()
assert_array_almost_equal(x,[0,1,1,2, 2, 3,3,4,4,5,5,6,6,7,7,8,8,9,9,10])
assert_array_almost_equal(y,[0,0,2,2,-4,-4,4,4,5,5,0,0,1,1,2,2,9,9,0, 0])
assert_array_almost_equal(ext,[0,10,-4,9])
h = Histogram(10,[-1,9])
h.data = np.array([-1,2,-4,4,5,0,1,2,9,-10],dtype=np.int64)
x,y,ext = h.asline()
assert_array_almost_equal(x,[-1, 0,0,1, 1, 2,2,3,3,4,4,5,5,6,6,7,7,8, 8, 9])
assert_array_almost_equal(y,[-1,-1,2,2,-4,-4,4,4,5,5,0,0,1,1,2,2,9,9,-10,-10])
assert_array_almost_equal(ext,[-1,9,-10,9])
h = Histogram(10,[0,10])
h.data = np.array([1,2,3,4,5,0,1,2,9,0],dtype=np.int64)
x,y,ext = h.asline(2)
assert_array_almost_equal(x,[2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10])
assert_array_almost_equal(y,[3,3,4,4,5,5,0,0,1,1,2,2,9,9,0, 0])
assert_array_almost_equal(ext,[2,10,0,9])
x,y,ext = h.asline(1.9)
assert_array_almost_equal(x,[2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10])
assert_array_almost_equal(y,[3,3,4,4,5,5,0,0,1,1,2,2,9,9,0, 0])
assert_array_almost_equal(ext,[2,10,0,9])
x,y,ext = h.asline(2.9,7)
assert_array_almost_equal(x,[3,4,4,5,5,6])
assert_array_almost_equal(y,[4,4,5,5,0,0])
assert_array_almost_equal(ext,[3,6,0,5])