diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-07-01 16:10:15 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-07-01 16:10:15 +0200 |
commit | b08408d23186205e71dfc68634021e3236bfb45c (patch) | |
tree | 55e5679b6964902dadab1d5737546cfd4f0f2f0a /simulationMatchesPyplot.py | |
parent | ddde2a9a43daf870c26bef33f47abe45b414c3d0 (diff) | |
download | imago-b08408d23186205e71dfc68634021e3236bfb45c.tar.gz imago-b08408d23186205e71dfc68634021e3236bfb45c.zip |
First version.
Diffstat (limited to 'simulationMatchesPyplot.py')
-rwxr-xr-x | simulationMatchesPyplot.py | 27 |
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() |