diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2014-10-24 12:16:51 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2014-10-24 12:16:51 -0400 |
| commit | ece1d828d53d6123fcecb5ea8bf9b126d1728ccc (patch) | |
| tree | b669382d0e5f1234556d1aeb7fa919891510b24d /distribution.py | |
| parent | 7426d8ff0e7969eb1a86bdb5bec8a0c971309e2b (diff) | |
| download | fast-seeding-ece1d828d53d6123fcecb5ea8bf9b126d1728ccc.tar.gz | |
Add code
Diffstat (limited to 'distribution.py')
| -rw-r--r-- | distribution.py | 30 |
1 files changed, 0 insertions, 30 deletions
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:]) |
