From 68c128ebe2543d212bb4d9b737f26b2393540ab7 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Thu, 12 May 2022 11:45:23 +0200 Subject: [PATCH] Tidy up plot --- slr/get_slr_distributions.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/slr/get_slr_distributions.py b/slr/get_slr_distributions.py index bc4dc85..a878a35 100644 --- a/slr/get_slr_distributions.py +++ b/slr/get_slr_distributions.py @@ -100,6 +100,10 @@ if PLOT: for i, row in dff.iterrows(): j += 1 + x_min = row[5] + (row[5] - row[50]) + x_max = row[95] + (row[95] - row[50]) + x = np.linspace(x_min, x_max, num=1000) + y = stats.cauchy(loc=row['loc'], scale=row['scale']).pdf(x) ax.plot(x, y * row['scale'], c=c[j]) if j % 2 == 0: @@ -109,7 +113,7 @@ if PLOT: clip_on=False, rotation=90) - ax.set_ylim(top=0.35) + ax.set_ylim(bottom=0, top=0.35) ax.set_yticks([]) ax.set_xlabel('SLR (m)', labelpad=10) ax.set_ylabel('Normalised probability density (-)', labelpad=10) @@ -117,3 +121,5 @@ if PLOT: ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) plt.show() + +