aboutsummaryrefslogtreecommitdiff
path: root/simulationMatchesPyplot.py
blob: 809e1a1da84069b285361b8074c9006971803f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()