summaryrefslogtreecommitdiff
path: root/sampling_alg_lac2020/midi_tests/plot_histogram.py
diff options
context:
space:
mode:
Diffstat (limited to 'sampling_alg_lac2020/midi_tests/plot_histogram.py')
-rwxr-xr-xsampling_alg_lac2020/midi_tests/plot_histogram.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/sampling_alg_lac2020/midi_tests/plot_histogram.py b/sampling_alg_lac2020/midi_tests/plot_histogram.py
index ca529b7..931e177 100755
--- a/sampling_alg_lac2020/midi_tests/plot_histogram.py
+++ b/sampling_alg_lac2020/midi_tests/plot_histogram.py
@@ -14,9 +14,19 @@ output_file = sys.argv[2]
f = open(input_file)
X = [int(i) for i in f.readlines()]
+X.sort()
+
+# Y = {}
+# for x in X:
+# if x in Y:
+# Y[x] = Y[x] + 1
+# else:
+# Y[x] = 1
+#
+# print(Y)
# the histogram of the data
-n, bins, patches = plt.hist(X, max(X)-min(X), facecolor='green')
+n, bins, patches = plt.hist(X, max(X)-min(X)+1, facecolor='green')
# add a 'best fit' line
# y = mlab.normpdf( bins, mu, sigma)
@@ -26,6 +36,8 @@ plt.xlabel('Sample Index')
plt.ylabel('Number of Selections')
# plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
# plt.axis([40, 160, 0, 0.03])
+
+# TODO: adapt for different drum kits!
plt.xlim(0,97)
plt.grid(True)