From 962b5a8007af5289bbae3677a422a6fe1290397d Mon Sep 17 00:00:00 2001 From: loicduffar <32878622+loicduffar@users.noreply.github.com> Date: Wed, 13 Oct 2021 19:20:58 +0200 Subject: [PATCH 1/2] Update utils.py --- standard_precip/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/standard_precip/utils.py b/standard_precip/utils.py index b7d6cd9..9ea969f 100644 --- a/standard_precip/utils.py +++ b/standard_precip/utils.py @@ -69,12 +69,13 @@ def best_fit_distribution(data: np.array, dist_list: list, fit_type: str='lmom', sse: dict (key - distribution, value - sum of square error) The sum of the squares error between fitted distribution and pdf. ''' + from standard_precip.lmoments import distr y, x = np.histogram(data, bins=bins, normed=True) x = (x + np.roll(x, -1))[:-1] / 2.0 sse = {} fig, ax = plt.subplots() - ax.bar(x, y, width=0.5, align='center', color='b', alpha=0.5, label='data') + ax.scatter(x, y, color='b', alpha=0.5, label='data') for dist_name in dist_list: distrb = getattr(distr, dist_name) From 7d2dd786e078668dd4d0025bb9607712c487f969 Mon Sep 17 00:00:00 2001 From: loicduffar <32878622+loicduffar@users.noreply.github.com> Date: Wed, 13 Oct 2021 19:52:09 +0200 Subject: [PATCH 2/2] Update utils.py --- standard_precip/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard_precip/utils.py b/standard_precip/utils.py index 9ea969f..4a06417 100644 --- a/standard_precip/utils.py +++ b/standard_precip/utils.py @@ -75,7 +75,7 @@ def best_fit_distribution(data: np.array, dist_list: list, fit_type: str='lmom', sse = {} fig, ax = plt.subplots() - ax.scatter(x, y, color='b', alpha=0.5, label='data') + ax.scatter(x, y, color='b', alpha=1, label='data') for dist_name in dist_list: distrb = getattr(distr, dist_name)