From 8131d12e389c91624756ded8c55db59068555b73 Mon Sep 17 00:00:00 2001 From: lpyka Date: Fri, 21 Mar 2025 15:23:33 +0100 Subject: [PATCH] plotting log-scale now --- 6b_compare_5_and_6/plot_precrack.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/6b_compare_5_and_6/plot_precrack.py b/6b_compare_5_and_6/plot_precrack.py index ab9de16..94ef8ad 100644 --- a/6b_compare_5_and_6/plot_precrack.py +++ b/6b_compare_5_and_6/plot_precrack.py @@ -46,19 +46,23 @@ def plot_current_and_toughness(filepaths_dict : dict): print(hierarchical_array[:,0]) axs[0].errorbar(hierarchical_array[:,0], hierarchical_array[:,1], yerr = hierarchical_array[:,2], - fmt='x', color = 'black') + fmt='x', capsize=5.0, color = 'black') axs[0].errorbar(random_reference_array[:,0], random_reference_array[:,1], yerr = random_reference_array[:,2], - fmt='o', color = 'grey') + fmt='o', capsize=5.0, color = 'grey') axs[1].errorbar(hierarchical_array[:,0], hierarchical_array[:,3], yerr = hierarchical_array[:,4], - fmt='x', color = 'black', label = "hierarchical") + fmt='x', capsize=5.0,color = 'black', label = "hierarchical") axs[1].errorbar(random_reference_array[:,0], random_reference_array[:,3], yerr = random_reference_array[:,4], - fmt='o', color = 'grey', label = "random same density per layer") + fmt='o', capsize=5.0,color = 'grey', label = "random same density per layer") axs[0].set_xlabel("Crack length") axs[1].set_xlabel("Crack length") axs[0].set_ylabel("Peak current") axs[1].set_ylabel("Toughness") axs[1].legend() + axs[0].set_xscale('log') + axs[0].set_xticks([5,10,20,40,80], labels=[5,10,20,40,80]) + axs[1].set_xscale('log') + axs[1].set_xticks([5,10,20,40,80], labels=[5,10,20,40,80]) plt.show() fig.savefig("current_toughness_crack_lenghts.png") -- GitLab