#!/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()