From cb51d29301f18db409c2fd3ce2bc3e7368438f21 Mon Sep 17 00:00:00 2001 From: wJsJwr Date: Thu, 13 Dec 2018 21:32:33 +0800 Subject: [PATCH] For 1.10 --- decision_time.py | 10 ++++++---- theta_plot.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 theta_plot.py diff --git a/decision_time.py b/decision_time.py index 52e710d..43590e9 100644 --- a/decision_time.py +++ b/decision_time.py @@ -36,12 +36,14 @@ colors = cm.get_cmap('OrRd') colors.set_bad('white') ax.set_xticklabels(np.arange(1, 46, 11)) dct = ax.imshow(ndata, cmap=colors, origin='lower')#, norm=colors.LogNorm()) - -ax.plot(np.arange(7, 45), np.floor(45 / np.arange(8, 46)), - marker='x', color='black', markersize=3, linestyle='none', markeredgewidth=0.5) +sc = ax.scatter(np.arange(7, 45), np.floor(45 / np.arange(8, 46)), s=20, facecolors='none', edgecolors='black', linewidths=0.75, linestyle='dotted', label='Maximal number of opponents') +plt.legend() +# ax2 = ax.twinx() +# ax2.set_ylabel("Maximal Number of opponents") ax.set_xlabel("Decision time") -ax.set_ylabel("Number of opponents") +ax.set_ylabel("Number of partners") fig.colorbar(dct, ax=ax, orientation='horizontal', aspect=40) # plt.show() +# print(plt.rcParams) plt.savefig('graph/decision_time.eps') diff --git a/theta_plot.py b/theta_plot.py new file mode 100644 index 0000000..e3582ea --- /dev/null +++ b/theta_plot.py @@ -0,0 +1,29 @@ +import numpy as np +from matplotlib import pyplot as plt +import scipy as sp +from matplotlib import markers +blue = '#0984e3' +red = '#d63031' + +x = np.arange(1, 16) +tc = np.loadtxt("outputs/EID_CLASSIC.csv", delimiter=',') +ts = np.loadtxt("outputs/EID_SURVIVE.csv", delimiter=',') + +fig = plt.figure(figsize=(6,4.5)) +ax = fig.gca() +ax.plot(x[:-1], tc[:-1], 'o--', color='limegreen', linewidth=2, label=r"Classic") +ax.plot(x[:-1], ts[:-1], 'o-', color='darkorange', linewidth=2, label=r"Dissipative") + +ax.set_ylim(-1500, 500) +ax.set_yticks(sp.linspace(-1500, 500, 6)) +ax.tick_params(labelsize=14) +ax.set_xlim(1, 15) +ax.set_xticks(sp.linspace(1,15,8, dtype=int)) +ax.set_xlabel("Rounds", size=22) +ax.set_ylabel(r"$\theta$", family='sans-serif', size=22) +# ax.tick_params(axis='y', labelcolor=red) + +plt.legend(numpoints=2, fontsize=14) +plt.tight_layout() +# plt.show() +plt.savefig("graph/theta_plot.eps")