From db12e5dae3629b0448adaf9c1ec2540c593eb15b Mon Sep 17 00:00:00 2001 From: wJsJwr Date: Sun, 23 Dec 2018 11:39:44 +0800 Subject: [PATCH] for 1.12 --- break_tie_bar.py | 1 + eid_plot.py | 3 +++ fc_plot.py | 8 +++++--- food_loss.py | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/break_tie_bar.py b/break_tie_bar.py index b568f3f..6c4071f 100644 --- a/break_tie_bar.py +++ b/break_tie_bar.py @@ -44,6 +44,7 @@ ax.set_xticks(index + bar_width / 2) ax.set_xticklabels(('C', 'D')) ax.set_xlabel('Previous Move') ax.set_ylim(0,100) +ax.tick_params(direction='in') ax.legend(loc='upper left') fig.tight_layout() # plt.show() diff --git a/eid_plot.py b/eid_plot.py index 7a6a553..fe29430 100644 --- a/eid_plot.py +++ b/eid_plot.py @@ -27,6 +27,8 @@ def p1(x, coopr, e, postfix, show=True): ax.tick_params(axis='y', labelcolor=blue) ax2.set_ylabel(r"$\theta$", family='sans-serif', color=red, size=22) ax2.tick_params(axis='y', labelcolor=red) + ax.tick_params(direction='in') + ax2.tick_params(direction='in') plt.tight_layout() if show: @@ -56,6 +58,7 @@ def p2(e, coopr, postfix, show=True, showline=True): ax.tick_params(labelsize=14) ax.set_ylim(0.6, 1) ax.set_yticks(sp.linspace(0.6, 1, 5)) + ax.tick_params(direction='in') plt.tight_layout() if show: plt.show() diff --git a/fc_plot.py b/fc_plot.py index 5951126..8dafa52 100644 --- a/fc_plot.py +++ b/fc_plot.py @@ -8,13 +8,15 @@ blue = '#0984e3' red = '#d63031' def p1(x, coopr, postfix, show=True): - fig = plt.figure(figsize=(4.5, 3)) + fig = plt.figure(figsize=(4.5, 2)) ax = fig.gca() ax.plot(x, coopr, 'o-', color=blue, linewidth=2, label="$f_c$") - ax.set_ylim(0, 1) - ax.set_yticks(sp.linspace(0, 1, 5)) + ax.set_ylim(0.5, 1) + ax.set_yticks(sp.linspace(0.5, 1, 5)) ax.tick_params(labelsize=18) + ax.tick_params(direction='in') ax.set_xlim(0, 16) + # ax.set_xticklabels(['']) ax.set_xlabel("Rounds", size=22) ax.set_ylabel(r"$f_c$", family='sans-serif', size=22) ax.yaxis.grid(True, linestyle='--') diff --git a/food_loss.py b/food_loss.py index 8899fca..74ff708 100644 --- a/food_loss.py +++ b/food_loss.py @@ -83,6 +83,7 @@ if __name__ == '__main__': ax.set_xticklabels(['C', 'D']) ax.set_ylim(-6, 6) ax.set_xlabel("Previous Move") + ax.tick_params(direction='in') ax.legend([hdl1, hdl2], labels, ncol=2) fig.tight_layout()