From ece1d828d53d6123fcecb5ea8bf9b126d1728ccc Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Fri, 24 Oct 2014 12:16:51 -0400 Subject: Add code --- distribution.py | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 distribution.py (limited to 'distribution.py') diff --git a/distribution.py b/distribution.py deleted file mode 100644 index 49d2d5e..0000000 --- a/distribution.py +++ /dev/null @@ -1,30 +0,0 @@ -import matplotlib.pyplot as plt -import numpy as np -import sys - - -def load_distribution(filename): - l = [int(line.strip()) for line in open(filename)] - l = sorted(l) - l = l[:] - return l - - -def plot_distribution(files): - for file in files: - x = load_distribution(file) - a = np.array(x) - print file, a.mean(), a.size - n, bins, patches = plt.hist(x, 50, normed=1, facecolor='green') - plt.show() - # # n_nodes = float(sum(y)) - # plt.plot(x, np.array(y), ".") - # if save: - # fig = plt.gcf() - # fig.set_size_inches(20, 15) - # # plt.savefig(output, bbox_inches="tight") - # else: - # plt.show() - -if __name__ == "__main__": - plot_distribution(sys.argv[1:]) -- cgit v1.2.3-70-g09d2