本文整理汇总了Python中rootpy.plotting.Hist.overflow方法的典型用法代码示例。如果您正苦于以下问题:Python Hist.overflow方法的具体用法?Python Hist.overflow怎么用?Python Hist.overflow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rootpy.plotting.Hist
的用法示例。
在下文中一共展示了Hist.overflow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_overflow_underflow
# 需要导入模块: from rootpy.plotting import Hist [as 别名]
# 或者: from rootpy.plotting.Hist import overflow [as 别名]
def test_overflow_underflow():
h1d = Hist(10, 0, 1)
h1d.Fill(-1)
h1d.Fill(2)
assert_equal(h1d.underflow(), 1)
assert_equal(h1d.overflow(), 1)
h2d = Hist2D(10, 0, 1, 10, 0, 1)
h2d.Fill(-1, .5)
h2d.Fill(2, .5)
assert_equal(h2d.underflow()[h2d.axis(1).FindBin(.5)], 1)
assert_equal(h2d.overflow()[h2d.axis(1).FindBin(.5)], 1)
h2d.Fill(.5, -1)
h2d.Fill(.5, 2)
assert_equal(h2d.underflow(axis=1)[h2d.axis(0).FindBin(.5)], 1)
assert_equal(h2d.overflow(axis=1)[h2d.axis(0).FindBin(.5)], 1)
h3d = Hist3D(10, 0, 1, 10, 0, 1, 10, 0, 1)
h3d.Fill(-1, .5, .5)
h3d.Fill(2, .5, .5)
assert_equal(h3d.underflow()[h3d.axis(1).FindBin(.5)][h3d.axis(2).FindBin(.5)], 1)
assert_equal(h3d.overflow()[h3d.axis(1).FindBin(.5)][h3d.axis(2).FindBin(.5)], 1)
h3d.Fill(.5, -1, .5)
h3d.Fill(.5, 2, .5)
assert_equal(h3d.underflow(axis=1)[h3d.axis(0).FindBin(.5)][h3d.axis(2).FindBin(.5)], 1)
assert_equal(h3d.overflow(axis=1)[h3d.axis(0).FindBin(.5)][h3d.axis(2).FindBin(.5)], 1)
h3d.Fill(.5, .5, -1)
h3d.Fill(.5, .5, 2)
assert_equal(h3d.underflow(axis=2)[h3d.axis(0).FindBin(.5)][h3d.axis(1).FindBin(.5)], 1)
assert_equal(h3d.overflow(axis=2)[h3d.axis(0).FindBin(.5)][h3d.axis(1).FindBin(.5)], 1)