# HG changeset patch # User Nicolas Saunier # Date 1368064966 -7200 # Node ID 99ca91a46007464b55e550e340f4cbb6fa3804d2 # Parent efd4dd4665ac96c3438e5211e0012ccacd795bf7 minor change diff -r efd4dd4665ac -r 99ca91a46007 python/utils.py --- a/python/utils.py Wed May 08 00:19:28 2013 +0200 +++ b/python/utils.py Thu May 09 04:02:46 2013 +0200 @@ -287,17 +287,18 @@ # plotting section ######################### -def stepPlot(X, firstX, lastX, initialCount = 0): - '''for each value in x, increment by one the initial count +def stepPlot(X, firstX, lastX, initialCount = 0, increment = 1): + '''for each value in X, increment by increment the initial count returns the lists that can be plotted - to obtain a step plot increasing by one for each value in x, from first to last value''' + to obtain a step plot increasing by one for each value in x, from first to last value + firstX and lastX should be respectively smaller and larger than all elements in X''' sortedX = [] counts = [initialCount] for x in sorted(X): sortedX += [x,x] counts.append(counts[-1]) - counts.append(counts[-1]+1) + counts.append(counts[-1]+increment) counts.append(counts[-1]) return [firstX]+sortedX+[lastX], counts