From c180c23a0597270e896d2dbeae7bee9363a29065 Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Tue, 13 May 2014 15:42:20 -0400 Subject: [PATCH] cumulaive instead of differential number function --- python_tools/void_python_tools/voidUtil/plotUtil.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python_tools/void_python_tools/voidUtil/plotUtil.py b/python_tools/void_python_tools/voidUtil/plotUtil.py index 8af063b..24b708c 100644 --- a/python_tools/void_python_tools/voidUtil/plotUtil.py +++ b/python_tools/void_python_tools/voidUtil/plotUtil.py @@ -72,6 +72,13 @@ def plotNumberFunction(catalogList, figDir="./", bins = 100./5. hist, binEdges = np.histogram(data, bins=bins, range=(0., 100.)) binCenters = 0.5*(binEdges[1:] + binEdges[:-1]) + + foundStart = False + for iBin in xrange(len(hist)): + if not foundStart and hist[iBin] == 0: + continue + foundStart = True + hist[iBin] = np.sum(hist[iBin:]) nvoids = len(data) var = hist * (1. - hist/nvoids)