aboutsummaryrefslogtreecommitdiff
path: root/simulationMatchesPyplot.py
diff options
context:
space:
mode:
Diffstat (limited to 'simulationMatchesPyplot.py')
-rwxr-xr-xsimulationMatchesPyplot.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/simulationMatchesPyplot.py b/simulationMatchesPyplot.py
new file mode 100755
index 0000000..809e1a1
--- /dev/null
+++ b/simulationMatchesPyplot.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+"""Uses pyplot to create graphs of the results of MonteCarlo simulations"""
+
+import matplotlib.pyplot as plt
+import numpy as np
+
+data = np.loadtxt("out/size9_scoreDiffHeur10.dat")
+
+dic = {}
+for value in data:
+ if value in dic.keys():
+ dic[value] += 1
+ else:
+ dic[value] = 1
+
+names = list(dic.keys())
+values = list(dic.values())
+
+fig, axs = plt.subplots(1, 3, figsize=(9, 3), sharey=True)
+axs[0].bar(names, values)
+axs[1].scatter(names, values)
+axs[2].plot(names, values)
+axs[2].axis([-10, 10, 0, max(values)+2])
+fig.suptitle('Categorical Plotting')
+
+plt.show()